03.01.2012, 15:24
It's possible by creating a timer which calls every second or half second a callback which checks if any player is in this area or not.
First we need the timer in OnGameModeInit or OnFilterScriptInit
then this
First we need the timer in OnGameModeInit or OnFilterScriptInit
pawn Код:
//...
SetTimer("SlowUpdate", 500, true);
//...
pawn Код:
new bool:isInAtm[MAX_PLAYERS];
forward SlowUpdate();
public SlowUpdate()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(!IsPlayerConnected(playerid)) continue;
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2166.80, 1905.00, 10.72))
{
if(!isInAtm[playerid])
{
isInAtm[playerid] = true;
ShowPlayerDialog(playerid, DIALOG_BANKMAIN, DIALOG_STYLE_LIST, "{FFFF00}Bank Account", "Create Bank Account\nLogin Bank Account", "Select", "Cancel");
}
}
else if(isInAtm[playerid]) isInAtm[playerid] = false;
}
}