Is Player Inside Area
#1

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);
    }
Reply
#2

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)