IsPlayerInRangeOfPoint
#6

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
pawn Код:
//...
SetTimer("SlowUpdate", 500, true);
//...
then this
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;
    }
}
Reply


Messages In This Thread
IsPlayerInRangeOfPoint - by Konstantinos - 03.01.2012, 14:00
Re: IsPlayerInRangeOfPoint - by fordawinzz - 03.01.2012, 14:19
Re: IsPlayerInRangeOfPoint - by Konstantinos - 03.01.2012, 14:23
Re: IsPlayerInRangeOfPoint - by Babul - 03.01.2012, 14:58
Re: IsPlayerInRangeOfPoint - by Konstantinos - 03.01.2012, 15:04
AW: IsPlayerInRangeOfPoint - by BigETI - 03.01.2012, 15:24
Re: IsPlayerInRangeOfPoint - by Konstantinos - 03.01.2012, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)