SA-MP Forums Archive
Why this Wont work! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why this Wont work! (/showthread.php?tid=264523)



Why this Wont work! - Unknown_Killer - 26.06.2011

i`m trying to check if player was @ point then other player went to that point it wont work till the first player leave that point .

here my codes

pawn Код:
forward Refill();

new RefillArea[MAX_PLAYERS];

new bool:wentinsidetp;

public OnGameModeInit()
{
SetTimer("Refill", 1000, true);
}

public OnPlayerSpawn(playerid)
{
wentinsidetp = false;
}

public Refill()
{
foreach(Player, i)
 {
     if(PlayerToPoint(1, i, -242.6534,2811.0254,62.1717))
     {
            if(RefillArea[i] == 0 && wentinsidetp == false)
            {
                if(Team[i] == trucker)
                {
                    TextDrawShowForPlayer(i, refillTake[i]);
                    RefillArea[i] = 1;
                    wentinsidetp = true;
        }
                else
                {
        wentinsidetp = true;
                new str[128], name[MAX_PLAYER_NAME];
                GetPlayerName(i, name, sizeof(name));
                format(str, sizeof(str), "%s is refilling his truck", name);
                SendClientMessageToAll(COLOR_ORANGE,str);
                RefillArea[i] = 1;
                SendClientMessage(i,COLOR_CON_GREEN, "*Stay In here for 25 seconds to refill your truck");
                Timerefill[i] = SetTimer("refillend",25000,0);
                }
            }
       }
            else
       {
            RefillArea[i] = 0;
            KillTimer(Timerefill[i]);
       wentinsidetp = false;
           TextDrawHideForPlayer(i, refillTake[i]);
        }
     }
     return 1;
}
the problem is when more than 1 player in server the codes wont work.


Re: Why this Wont work! - Skaizo - 26.06.2011

Код:
public Refill()
{
   foreach(Player, i)
   { 
       if(PlayerToPoint(1, i, -242.6534,2811.0254,62.1717))
       {
           if(RefillArea[i] == 0 && wentinsidetp == false)
           {
              if(Team[i] == trucker)
              {
                  TextDrawShowForPlayer(i, refillTake[i]);
                  RefillArea[i] = 1;
                  wentinsidetp = true;
              }
              else
              {
                  wentinsidetp = true;
                  new str[128], name[MAX_PLAYER_NAME];
                  GetPlayerName(i, name, sizeof(name));
                  format(str, sizeof(str), "%s is refilling his truck", name);
                  SendClientMessageToAll(COLOR_ORANGE,str);
                  RefillArea[i] = 1;
                  SendClientMessage(i,COLOR_CON_GREEN, "*Stay In here for 25 seconds to refill your truck");
                  Timerefill[i] = SetTimer("refillend",25000,0);
                  }
              }
         }
         else
         {
            RefillArea[i] = 0;
            KillTimer(Timerefill[i]);
            wentinsidetp = false;
            TextDrawHideForPlayer(i, refillTake[i]);
            }
        }
        return 1;
}



Re: Why this Wont work! - Unknown_Killer - 26.06.2011

huh what did u do skaizo cz i cant see any difference ...

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.




Re: Why this Wont work! - Skaizo - 26.06.2011

because you did not correct the space