HVT capture and surrendering function

Description
This function makes a unit surrender when a player comes near enough. Trigger is attached to the unit so this will work even on moving units, trigger is 2 meters high, so if the unit is on the upper floor of a building players will need to reach the same height. Triggers are created globaly, therefore the code will be called globally. Unit (parameter 0) is passed to the code.

Function Header
Function name:MRH_fnc_VipSurrender Author: Mr H. Description: This function makes a unit surrender when a player comes near enough. Trigger is attached to the unit so this will work even on moving units, trigger is 2 meters high, so if the unit is on the upper floor of a building players will need to reach the same height. Triggers are created globaly, therefore the code will be called globally. Unit (parameter 0) is passed to the code. Return value: None Public: Yes Parameters: 0 -  - Unit that will surrender 1 -  - Distance from the unit under which they will surrender 3 -  - Message to display when unit is captured, will be displayed in global chat, said by the unit. 4 -  -Optional code to execute, _unit is passed as a parameter, code must be stated between {} Example(s): [this,5,"I surrender!"] call MRH_fnc_VipSurrender; or [this,10,"I will never surrender!", {(_this select 0) setDamage 1; hint str _this;}] call MRH_fnc_VipSurrender;