[Q]Click on ESC..
#1

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

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

emm, OnPlayerDisconnect ?
Reply
#4

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

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

Thanks it's working..
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)