[Include] pause.inc (Check for players pause/AFK status.)
#1

Pause (v1.1)

View code and download: https://gist.github.com/AmirSavand/9...57570cc5902221

Leave comments here or on the GitHub page if you have any questions/suggestions.


Installation

Just include it in the gamemode or filterscript.


Usage

Default PAUSE_LIMIT (Time to set player as inactive/paused) value is 3 seconds, you can change that.

Watch OnPlayerPause(playerid) to handle player pause.

Watch OnPlayerResume(playerid, duration) to handle player resume (duration in seconds).

Call IsPlayerPaused(playerid) to check player pause/AFK status (returns boolean).


Example

PHP код:
hook OnPlayerPause(playerid)
{
    
printf("%s has paused."RGetPlayerName(playerid));
}
hook OnPlayerResume(playeridduration)
{
    
printf("%s just resumed after %i seconds."RGetPlayerName(playerid), duration);

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)