Пожалуйста Войдите или Зарегистрируйтесь чтобы увидеть скрытое содержание
кстати эта тема реализована в арме по ванили.
в смысле запуск по таймеру
Можно по подробнее? Я вкурсе только про sleep
a3\functions_f\Misc\fn_runLater.sqf
a3\functions_f\Misc\fn_loop.sqf
/*
Author: Nelson Duarte
Description:
Run some code later
Delay can be in seconds, frames and/or custom condition
Code and conditions are executed in non-schedule environment
Parameters:
_this select 0: Unique id
_this select 1: Code/function that is executed later
_this select 2: The timer value (can be in seconds or frames)
_this select 3: The timer type, can be "seconds" or "frames"
_this select 4: The custom condition, code is only executed if timer is validated and condition is met
Returns:
NOTHING
Examples:
["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater; //Hints current game time in the next frame after 5 seconds have passed
["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater; //Hints current game time in the next frame after 120 frames have passed
["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater; //Hints current game time in the next frame after BIS_variable is assigned
["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater; //Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned
["uniqueId", { hint str time; }] call BIS_fnc_runLater; //Hints current game time in the next frame
*/
/*
Author: Nelson Duarte
Description:
Loop stacked code/function with timing and conditional control
Code and conditions are executed in non-scheduled environment
Parameters:
_this select 0: Action
_this select 1: Parameters
Returns:
NOTHING
Examples:
["initialize"] call BIS_fnc_loop; //Initializes game loop (not required if AUTO_INITIALIZE is set to true)
["terminate"] call BIS_fnc_loop; //Terminates game loop
["itemAdd", ["uniqueId", { hint str time; }, 5]] call BIS_fnc_loop; //Hints time every five seconds
["itemAdd", ["uniqueId", { hint str time; }, 120, "frames"]] call BIS_fnc_loop; //Hints time every 120 frames
["itemAdd", ["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }]] call BIS_fnc_loop; //Hints time every frame after BIS_variable is assigned
["itemAdd", ["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }]] call BIS_fnc_loop; //Hints time every five seconds after BIS_variable is assigned
["itemAdd", ["uniqueId", { hint str time; }]] call BIS_fnc_loop; //Hints time every frame
["itemRemove", ["uniqueId"]] call BIS_fnc_loop; //Remove item from loop with id "uniqueId"
*/