#1

Hi,

How to check is player pressed ESC?
Reply
#2

See this.
Reply
#3

http://forum.sa-mp.com/showthread.ph...sed#post862522
Reply
#4

Код:
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?
Reply
#5

Delete Kick(playerid);
Reply
#6

But this check, is checking is player pressed ESC? and how check when player back from esc?
Reply
#7

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.
Reply
#8

Then how it's possible to check?
Reply
#9

UPING
Reply
#10

Uping
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)