[NATIVE] User AFK status
Posted: Fri Sep 25, 2026 4:11 am
User AFK status
This plugin has two natives that can be used to determine how long player is AFK or set his AFK time.
I made this plugin a long time ago, faced strange problems creating it, so some parts of the code may look a bit strange, but it works as it should. I know there are other method(s) to do this, but someone may still find this usefull. I know I did.
Natives
get_user_afktime(id) - returns player's AFK time.
set_user_afktime(id, Float:time) - Sets player's AFK time.
Usage
This plugin has two natives that can be used to determine how long player is AFK or set his AFK time.
I made this plugin a long time ago, faced strange problems creating it, so some parts of the code may look a bit strange, but it works as it should. I know there are other method(s) to do this, but someone may still find this usefull. I know I did.
Natives
get_user_afktime(id) - returns player's AFK time.
set_user_afktime(id, Float:time) - Sets player's AFK time.
Usage
Code: Select all
/*
* Returns user's inactivity time.
*
* @param id Player index.
*
* @return Time in seconds (Float).
*
* Example:
* new Float:afkTime = get_user_afktime(id)
*/
native Float:get_user_afktime(id)
/*
* Sets user's inactivity time.
*
* @param id Player index.
* @param Float:value Time in seconds (Float).
*
* Example:
* set_user_afktime(id, 15.0)
*/
native set_user_afktime(id, Float:value)