24.02.2011, 16:29
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;
}
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);
}