SA-MP Forums Archive
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)
+--- Thread: ESC (/showthread.php?tid=417712)



ESC - audriuxxx - 22.02.2013

Hi,

How to check is player pressed ESC?


Re: ESC - Rock - 22.02.2013

See this.


Re: ESC - Dragony92 - 22.02.2013

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


Re: ESC - audriuxxx - 22.02.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?


Re: ESC - Rock - 22.02.2013

Delete Kick(playerid);


Re: ESC - audriuxxx - 22.02.2013

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


Re: ESC - mamorunl - 22.02.2013

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.


Re: ESC - audriuxxx - 22.02.2013

Then how it's possible to check?


Re: ESC - audriuxxx - 23.02.2013

UPING


Re: ESC - audriuxxx - 23.02.2013

Uping