Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while {true} do
- {
- // Pega todas as unidades dentro da area
- _inSideUnits = (allUnits select {(_x inArea triggerName)});
- // Debug
- hint str count _inSideUnits;
- // loop - Faz para cada player expecifico
- {
- // Cria variavel privada a partir da variavel global
- private _curTime = _x getVariable "cur_Time";
- // Checa se a variavel global existe no player, caso nao, cria a variavel com valor 0
- if (isNil "_curTime") then
- {
- _x setVariable ["cur_Time", 0, true];
- };
- // Se o tempo for igual a zero seta a variavel para 1
- if (_curTime = 0) then
- {
- _x setVariable ["cur_Time", 1, true];
- };
- // seo o tempo for maior que 0 adiciona +1 a cada segundo
- if (_curTime > 0) then
- {
- _curTime = _curTime +1;
- _x setVariable ["cur_Time", _curTime, true];
- };
- // se o tempo for maior ou igual a 30 teleporta o player e reseta a variavel
- if (_curTime >= 30) then
- {
- _x setPos (getPos _safetriggerName);
- _x setVariable ["cur_Time", _curTime, true];
- };
- } forEach _inSideUnits;
- Sleep 1;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement