SA-MP Forums Archive
Is Player Inside Area - 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: Is Player Inside Area (/showthread.php?tid=230950)



Is Player Inside Area - Criss_Angel - 24.02.2011

pawn Код:
forward CheckBank();
public CheckBank()
{
 for(new i=0; i < MAX_PLAYERS; i++)
  {
  if(IsPlayerConnected(i))
   {
      if(IsPlayerInRangeOfPoint(i, 10, 721.9122,-1654.8541,20.9688)) //|| (i, 10, 1965.0546,1622.8281,12.8648) || (i, 10, 1721.9122,-1654.8541,20.9688))
       {
         if(playerinfo[i][Bank] == 0)
           {
              playerinfo[i][Bank] = 1;
              SendClientMessage(i, COLOR_GREEN, "[ ! ] Welcome to the Bear Land Bank");
              return 1;
           }
        }
       else
         {
            if(playerinfo[i][Bank] == 1)
             {
                 SendClientMessage(i, COLOR_YELLOW,"[ ! ] You have left the bank");
                 playerinfo[i][Bank] = 0;
                 return 1;
             }
          }
       }
    }
 return 1;
}
I call it with a timer, but it doesnt work why??
TIMER:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
       BankTimer = SetTimerEx("CheckBank", 1000, true, "i", i);
       timetimer = SetTimerEx("TimeUpdate", 60000, true, "i", i);
       //SetTimer("LoadCars", 2500, false);
       //SetTimerEx("IsAtGasStation",2000,1,"i",i);
    }



Respuesta: Is Player Inside Area - TheChaoz - 24.02.2011

why don't u try using incognito's plugin. has functions for areas that are very useful


Re: Is Player Inside Area - Criss_Angel - 24.02.2011

I don't really want any plugins, I just want to use this simple code.