How to check if the player in ESC(Menu)
#5

pawn Код:
new bool:PlayerPaused[MAX_PLAYERS] = false,
InactiveTime[MAX_PLAYERS];

public OnGameModeInit()
{
    SetTimer("CheckForPausedPlayers", 1000, true);
    return 1;
}

public OnPlayerUpdate(playerid)
{  
    if(InactiveTime[playerid] >= 5) PlayerPaused[playerid] = false; // Player has unpaused their game.
    InactiveTime[playerid] = 0;
    return 1;
}

forward CheckForPausedPlayers();
public CheckForPausedPlayers()
{
    foreach(new i: Player)
    {
        if(PlayerPaused[i] == false)
        {
            InactiveTime[i] ++;
            if(InactiveTime[i] == 5) PlayerPaused[i] = true; // Player has paused their game.
        }
    }
}
Reply


Messages In This Thread
How to check if the player in ESC(Menu) - by WildWave - 30.09.2014, 21:35
Re: How to check if the player in ESC(Menu) - by Bingo - 30.09.2014, 21:41
Re: How to check if the player in ESC(Menu) - by TakeiT - 30.09.2014, 21:48
Re: How to check if the player in ESC(Menu) - by Catalyst- - 30.09.2014, 21:54
Re: How to check if the player in ESC(Menu) - by SickAttack - 30.09.2014, 22:09
Re: How to check if the player in ESC(Menu) - by TakeiT - 30.09.2014, 22:09
Re: How to check if the player in ESC(Menu) - by Catalyst- - 30.09.2014, 22:15
Re: How to check if the player in ESC(Menu) - by Abagail - 30.09.2014, 22:17
Re: How to check if the player in ESC(Menu) - by TakeiT - 30.09.2014, 22:22

Forum Jump:


Users browsing this thread: 3 Guest(s)