Sarge-AI/scripts/UPSMON/COMMON/Params/fnc/UPSMON_SetEventhandlers.sqf
Teh Dango 3ac749d64b 2.1.0
This is the latest stable version of Sarge AI for Arma 3: Exile.
2016-02-19 21:49:51 -05:00

52 lines
1.4 KiB
Plaintext

/****************************************************************
File: UPSMON_SetEventhandlers.sqf
Author: Azroul13
Description:
Convert argument list to uppercase
Parameter(s):
<--- Members of the group
<--- Parameters
Returns:
Nothing
****************************************************************/
private["_members","_UCthis","_grpid","_deletedead"];
_members = _this select 0;
_UCthis = _this select 1;
_grpid = _this select 2;
_deletedead = ["DELETE:",0,_UCthis] call UPSMON_getArg;
{
_x setVariable ["UPSMON_grpid", _grpid, false];
If (_x != vehicle _x && (vehicle _x) getVariable ["UPSMON_grpid",0] != _grpid) then {(vehicle _x) setVariable ["UPSMON_grpid", _grpid, false];};
sleep 0.05;
if (side _x != civilian) then
{//soldiers
_x AddEventHandler ["hit", {nul = _this spawn UPSMON_SN_EHHIT}];
sleep 0.05;
_x AddEventHandler ["killed", {nul = _this spawn UPSMON_SN_EHKILLED}];
//_x AddEventHandler ["fired", {nul = _this spawn UPSMON_SN_EHFIRED}];
}
else
{//civ
if (!isnil "_x") then
{
sleep 0.05;
_x AddEventHandler ["firedNear", {nul = _this spawn UPSMON_SN_EHFIREDNEAR}];
sleep 0.05;
_x AddEventHandler ["killed", {nul = _this spawn UPSMON_SN_EHKILLEDCIV}];
sleep 0.05;
};
};
if (_deletedead>0) then
{
_x addEventHandler['killed',format["[_this select 0,%1] spawn UPSMON_deleteDead",_deletedead]];
sleep 0.01;
};
} foreach _members;