RUST AFK API v1.0.1

No permission to download
You can download a maximum of 0 files within 24 hours

Features​

This a complex API using many factors (configurable) to decide, if player is AFK. Plugin could be useful even for people who does not develop plugins (chat commands for certain actions are included here, see Commands).

  • Getting player's AFK status
  • Getting player's AFK time
  • Getting list of AFK players
  • Setting up this plugin config through API, if needed and allowed in native config file

Permissions​

This plugin uses the permission system. To assign a permission, use oxide.grant <user or group> <name or steam id> <permission>. To remove a permission, use oxide.revoke <user or group> <name or steam id> <permission>.
  • afkapi.use - Allows player to use /isafk and /getafk commands
  • afkapi.kick - Allows player to kick all the AFK players at once

Chat Commands​

  • /isafk <Player name or id> - gives caller the status of targeted player (AFK, NOT AFK or OFFLINE)
  • /getafk - gives caller the list of AFK players
  • /kickafk - kicks all the AFK players from the server at once

Configuration​

The settings and options can be configured in the AFKAPI file under the config directory. The use of an editor and validator is recommended to avoid formatting issues and syntax errors.
Code:
Please, Log in or Register to view codes content!

Localization​

The default messages are in the AFKAPI file under the lang/en directory. To add support for another language, create a new language folder (e.g. de for German) if not already created, copy the default language file to the new folder and then customize the messages.
Code:
Please, Log in or Register to view codes content!

Developer API​

Getting started​

You'd need to reference plugin explicitely to use most hooks.

Use the magic reference to make plugin manager automatically check if the plugin is present

// Requires: AFKAPI

Use PluginReferenceAttribute to define the plugin field
Code:
Please, Log in or Register to view codes content!

Check if player is AFK​

API method

Will return true if the player is AFK, returns false if it's not or player is offline (or never been on the server)
Code:
Please, Log in or Register to view codes content!
Example call
Code:
Please, Log in or Register to view codes content!

Get player AFK time​

Note that this method will return time of player doing nothing (what is tracked by API), even if he is not considered AFK at the moment

API method

Will return number of seconds. Returns -1 if the player is not AFK / offline
Code:
Please, Log in or Register to view codes content!
Example call
Code:
Please, Log in or Register to view codes content!

Get list of AFK players​

API method
Code:
Please, Log in or Register to view codes content!
Example call

Code:
Please, Log in or Register to view codes content!

Setup plugin config through API​

Use this function only if highly required, it's always better to setup the native config manually to avoid conflicts with other plugins using this API and features

New plugin settings must be given as serialized json string. Use the class below and the example method to avoid errors.

API method

Will return true if settings are applied, needToSave might be used to save config file with new parameters (You can omit this, so settings will be keeped for this session only)
Code:
Please, Log in or Register to view codes content!
Settings class
Code:
Please, Log in or Register to view codes content!
Generate string
Code:
Please, Log in or Register to view codes content!
Example call
Code:
Please, Log in or Register to view codes content!
Author
Box2
Downloads
0
Views
8
First release
Last update
Rating
0.00 star(s) 0 ratings

Similar resources

Простой плагин для перевода AFK игроков в Наблюдатели
0.00 star(s) 0 ratings
Downloads
0
Updated
Многофункциональный плагин учета AFK игроков
0.00 star(s) 0 ratings
Downloads
0
Updated
0.00 star(s) 0 ratings
Downloads
0
Updated
AFK Control 12.08.2025 GP25.00
Многофункциональный плагин учета AFK игроков
0.00 star(s) 0 ratings
Downloads
0
Updated
0.00 star(s) 0 ratings
Downloads
0
Updated
Back
Top
Development Community