Sarge-AI/sarge/UPSMON/COMMON/unit/fnc/UPSMON_doStop.sqf
Teh Dango c5e98f17e6 Epoch Update
Epoch Update
2017-10-25 21:36:31 -04:00

33 lines
733 B
Plaintext

/****************************************************************
File: UPSMON_doStop.sqf
Author: MONSADA
Description:
Función que detiene al soldado y lo hace esperar x segundos
Parameter(s):
<--- unit
<--- Wait time
Returns:
****************************************************************/
private["_sleep","_npc"];
_npc = _this select 0;
_sleep = _this select 1;
sleep 0.05;
if (!alive _npc || !canmove _npc ) exitwith{};
if ( _sleep == 0 ) then {_sleep = 0.1};
//Restauramos valores por defecto de movimiento
if (((group _npc) getvariable "UPSMON_Grpstatus") select 0 == "FORTIFY") then
{
dostop _npc ;
_npc disableAI "TARGET";
}
else
{
dostop _npc ;
sleep _sleep;
[_npc] spawn UPSMON_cancelstop;
};