08.10.2018, 21:09
(
Последний раз редактировалось AmirSavand; 24.10.2018 в 01:05.
)
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
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(playerid, duration)
{
printf("%s just resumed after %i seconds.", RGetPlayerName(playerid), duration);
}