Description
Idle Manager API which handles Idle players for Source Python.
Installation
Download and unpack the latest release of Idle Manager to your server folder.
Configuration
There's a configuration file cfg/source-python/idle_manager.cfg that holds the ConVar for the Idle Time.
Usage
@OnClientIdle
Called when a Client is marked as Idle.
Syntax: Select all
from idle_manager import OnClientIdle
@OnClientIdle
def on_client_idle(index):
print("Index '{:d}' is now marked as Idle.".format(index))
@OnClientBack
Called when a Client is back from being Idle.
Syntax: Select all
from idle_manager import OnClientBack
@OnClientBack
def on_client_back(index):
print("Index '{:d}' is no longer marked as Idle.".format(index))
is_client_idle(index)
Returns the Client Idle Status for the given Client Index.
Syntax: Select all
from idle_manager import is_client_idle
from events import Event
from players.helpers import index_from_userid
@Event('player_say')
def player_say(game_event):
index = index_from_userid(game_event.get_int('userid'))
print("Idle Status for Index '{:d}': {}".format(index, is_client_idle(index)))
Github
https://github.com/Frag1337/Idle-Manager/releases
Changelog
6th May 2017
Code: Select all
- Naming Conventions according to PEP8
- Update README.md