JojoTheSlayer
Friday, 11th September 2009, 15:03
I had already made a mission using the basics with triggers so I thought I would try making it into a simple capture script instead. Its no where close as advance as some of them out there, but its built in the simplest language syntax... I had some issues with if () then {} else {} command for some reason, so thats why I didnt use that command to shorten it...
I dont think its heavy on resources tbh in regards to MP.
Text file renamed capture.sqs
Anyway, here is the script.
;// Light Capture script.
;// *********************
;//
;// Info: [UnitName, Maxdamage to surrender (0.1 to 1,dead)] exec "capture.sqs";
;// Example (in unit init): [this, 0.1] exec "capture.sqs";
;//
;// How it works:
;// *************
;// *If you injure him more than hes tolerance or get closer than 10m he will surrender and put hes weapons down.
;// *Stand 3m, or closer, from him for 15sec and he will be captured.
? (!(local server)) : exit
_man = _this select 0;
_injury = _this select 1;
#Check
? (!(alive _man) : exit
_damage = getdammage _man;
? (player distance _man < 10) : goto "Surrender"
? (_damage > _injury) and (alive _man) : goto "Surrender"
goto "Check"
#Surrender
hintSilent "I surrender!";
_man action ["DropWeapon", _man, primaryWeapon _man];
~2
_man action ["DropWeapon", _man, secondaryWeapon _man];
~2
_man disableAI "move";
_man playMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
~2
_man disableAI "anim";
goto "Capture"
#Capture
~10
? (!(alive _man) : exit
? (player distance _man < 3) : goto "Capture2"
goto "Capture"
#Capture2
~15
deleteVehicle _man;
hintSilent "Good job! Hes captured. Continue mission...";
exit
;// End script.
I dont think its heavy on resources tbh in regards to MP.
Text file renamed capture.sqs
Anyway, here is the script.
;// Light Capture script.
;// *********************
;//
;// Info: [UnitName, Maxdamage to surrender (0.1 to 1,dead)] exec "capture.sqs";
;// Example (in unit init): [this, 0.1] exec "capture.sqs";
;//
;// How it works:
;// *************
;// *If you injure him more than hes tolerance or get closer than 10m he will surrender and put hes weapons down.
;// *Stand 3m, or closer, from him for 15sec and he will be captured.
? (!(local server)) : exit
_man = _this select 0;
_injury = _this select 1;
#Check
? (!(alive _man) : exit
_damage = getdammage _man;
? (player distance _man < 10) : goto "Surrender"
? (_damage > _injury) and (alive _man) : goto "Surrender"
goto "Check"
#Surrender
hintSilent "I surrender!";
_man action ["DropWeapon", _man, primaryWeapon _man];
~2
_man action ["DropWeapon", _man, secondaryWeapon _man];
~2
_man disableAI "move";
_man playMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
~2
_man disableAI "anim";
goto "Capture"
#Capture
~10
? (!(alive _man) : exit
? (player distance _man < 3) : goto "Capture2"
goto "Capture"
#Capture2
~15
deleteVehicle _man;
hintSilent "Good job! Hes captured. Continue mission...";
exit
;// End script.