Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // initialize triggers on server
- {
- if (_x isKindOf "EmptyDetector") then {_trgs = _trgs + [_x]}
- } forEach synchronizedObjects _logic;
- _logic setVariable ["triggers", _trgs, TRUE];
- // Trigger Check
- _trgs = [];
- {
- if (triggerActivated _x) then {_trgs = _trgs + [_x]};
- } forEach (_logic getVariable "triggers");
- {
- _who = _x;
- if (local _who && alive _who && time > ((_who getVariable "BIS_zoneRest_timeout") + 2) && (if (_inverse) then {{vehicle _who in list _x} count _trgs > 0} else {{vehicle _who in list _x} count _trgs == 0}) && !(_who getVariable "BIS_deserter") && (if (_airExcluded && vehicle _who isKindOf "Air") then {FALSE} else {TRUE})) then {
- if (isPlayer _x) then {_x call _effectWarning};
- _x setVariable ["BIS_deserter", TRUE];
- [_x, _warningTime, _inverse, _trgs, _effectPunishment, _airExcluded] spawn {
- _deserter = _this select 0;
- _warningTime = _this select 1;
- _inverse = _this select 2;
- _trgs = _this select 3;
- _effectPunishment = _this select 4;
- _airExcluded = _this select 5;
- _t = time;
- while {time < _t + _warningTime && (if (_inverse) then {{vehicle _deserter in list _x} count _trgs > 0} else {{vehicle _deserter in list _x} count _trgs == 0}) && (if (_airExcluded && vehicle _deserter isKindOf "Air") then {FALSE} else {TRUE})} do {
- sleep 1
- };
- if (time >= _t + _warningTime) then {_deserter call _effectPunishment} else {_deserter setVariable ["BIS_deserter", FALSE]};
- };
- };
- } forEach (_logic getVariable "BIS_ZR_unitsList");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement