SA-MP Forums Archive
[Q]Click on ESC.. - 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: [Q]Click on ESC.. (/showthread.php?tid=119740)



[Q]Click on ESC.. - BombaNick - 09.01.2010

how i can to know if the player clicked on ESC?


Re: [Q]Click on ESC.. - [HiC]TheKiller - 09.01.2010

You don't, unless you find out if they are paused.


Re: [Q]Click on ESC.. - dice7 - 09.01.2010

emm, OnPlayerDisconnect ?


Re: [Q]Click on ESC.. - Correlli - 09.01.2010

Quote:
Originally Posted by dice7
emm, OnPlayerDisconnect ?
And what that callback has to do with detecting if player is pausing..?


Re: [Q]Click on ESC.. - dice7 - 09.01.2010

pawn Код:
new IsInMenu[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("MenuCheck", 1000, 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    IsInMenu[playerid] = 1;
    return 1;
}
forward MenuCheck();
public MenuCheck()
{
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsInMenu[playerid] == 0)
            {
                //player is in menu
            }
            IsInMenu[playerid] = 0;
        }
    }
}

public OnPlayerUpdate(playerid)
{
    IsInMenu[playerid] = 1;
    return 1;
}



Re: [Q]Click on ESC.. - _Gangster_ - 09.01.2010

Thanks it's working..


Re: [Q]Click on ESC.. - dice7 - 09.01.2010

You stop syncing when you pause, so OnPlayerUpdate stops being called. The above code will work if a players in the pause menu for a second or more