Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
How to check is player pressed ESC?
Posts: 484
Threads: 49
Joined: Feb 2011
Posts: 737
Threads: 338
Joined: Jan 2013
Код:
new LastPlayerUpdate[MAX_PLAYERS];
#define IsPlayerPaused(%1,%2) GetTickCount() > (LastPlayerUpdate[%1] + (%2 * 1000)) // Returns the paused time in seconds
// Example Usage:
public OnPlayerUpdate(playerid)
{
LastPlayerUpdate[playerid] = GetTickCount();
return 1;
}
// In a timer or something
if(IsPlayerPaused(playerid, 300) && GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) // 300 seconds = 5 minutes
{
Kick(playerid);
}
I don't understand why player is kicking? and what check is here?
Posts: 737
Threads: 338
Joined: Jan 2013
But this check, is checking is player pressed ESC? and how check when player back from esc?
Posts: 1,938
Threads: 16
Joined: Feb 2007
Reputation:
0
OnPlayerUpdate ONLY runs if a player is in the game. If the player has paused the game (ie pressed ESC or ALT-TABBED), OnPlayerUpdate won't run anymore.
Posts: 737
Threads: 338
Joined: Jan 2013
Then how it's possible to check?
Posts: 737
Threads: 338
Joined: Jan 2013
Posts: 737
Threads: 338
Joined: Jan 2013