Advertisement
SigWar

Untitled

Dec 29th, 2020
1,841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while {true} do
  2. {
  3.     // Pega todas as unidades dentro da area
  4.     _inSideUnits = (allUnits select {(_x inArea triggerName)});
  5.    
  6.     // Debug
  7.     hint str count _inSideUnits;
  8.    
  9.     // loop - Faz para cada player expecifico
  10.     {
  11.         // Cria variavel privada a partir da variavel global
  12.         private _curTime = _x getVariable "cur_Time";
  13.        
  14.         // Checa se a variavel global existe no player, caso nao, cria a variavel com valor 0
  15.         if (isNil "_curTime") then
  16.         {
  17.             _x setVariable ["cur_Time", 0, true];
  18.  
  19.         };
  20.        
  21.         // Se o tempo for igual a zero seta a variavel para 1
  22.         if (_curTime = 0) then
  23.         {
  24.             _x setVariable ["cur_Time", 1, true];
  25.         };
  26.        
  27.         // seo o tempo for maior que 0 adiciona +1 a cada segundo
  28.         if (_curTime > 0) then
  29.         {
  30.             _curTime = _curTime +1;
  31.             _x setVariable ["cur_Time", _curTime, true];
  32.         };
  33.  
  34.         // se o tempo for maior ou igual a 30 teleporta o player e reseta a variavel
  35.         if (_curTime >= 30) then
  36.         {
  37.             _x setPos (getPos _safetriggerName);
  38.             _x setVariable ["cur_Time", _curTime, true];
  39.         };
  40.        
  41.     } forEach _inSideUnits;
  42.    
  43.     Sleep 1;
  44. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement