Sarge-AI/scripts/UPSMON/COMMON/unit/fnc/UPSMON_doStop.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

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;
};