O poveste fara sfarsit. LaLeagane - It's all about gaming!

2006 and still counting.
AFK Control

COUNTER-STRIKE AFK Control 2.1.0

Caracteristici generale

Plugin-ul permite adaugarea pe server a unui sistem de control pentru jucatorii AFK. Acesta detecteaza jucatorii AFK si ii muta la spectator, iar ulterior dupa o anumita perioada, le da kick.

Sistemul dispune de:
  • Transferarea bombei (C4) daca se afla la un jucator AFK
  • Permite configurarea preferintelor sistemului prin Cvars
  • Suport Multi-Language
  • Suport API

Instructiuni de instalare

  • Fisierul afk_control.inc il copiem in folderul addons/amxmodx/scripting/include
  • Fisierul afk_control.sma il copiem in folderul addons/amxmodx/scripting
  • Compilam local fisierul afk_control.sma, tinand cont de biblioteca afk_control.inc
  • Fisierul afk_control.amxx rezultat in urma compilarii, il copiem in folderul addons/amxmodx/plugins
  • Fisierul afk_control.txt il copiem in folderul addons/amxmodx/data/lang
  • Fisierul afk_control.ini il copiem in folderul addons/amxmodx/configs
  • Intram in fisierul plugins.ini din folderul addons/amxmodx/configs si scriem afk_control.amxx (de preferat la sfarsitul listei)

Cerinte de compatibilitate


Cvars

Code:
;
; CONFIGURATION FILE afk_control.ini
;

;
; PLUGIN SETTINGS
;

; Save the player's distress time when they die to get it the next time they spawn
SAVE_TIME = 0

; Players with this flag(s) are not subject to plugin actions for AFK (0 - works for everyone)
IMMUNITY = 0

; Minimum number of players on the server for the plugin to start taking into account AFK players
MIN_PLAYERS = 10

; Maximum elapsed time a player can be AFK (in seconds)
MAX_TIME = 30

; When a certain percentage of player inactivity is reached, the plugin will mark him as AFK
; The value is indicated as a percentage
AFK_PERCENT = 40

; The number of warnings that the player will receive during the entire period of inactivity
WARNINGS = 3

; Inactivity time is reset by player actions
; Basic
; a - Any control button pressed (see cssdk_const.inc)
; b - Moved (will reset in a new round if there are plugins or actions that push/move players)
; c - The crosshair has moved (will reset in a new round if there are plugins or actions that push/move players)
; Auxiliary:
; d - Wrote a message in the chat
; e - Using the menu buttons
; ATTENTION: Letters can be used together!
RESET_TIME = a

; When the maximum inactivity time is reached, the plugin will immediately kick the player from the server without transferring him to the audience!
; If set to 1, will kick everyone except players with a flag (from the IMMUNITY setting)
; If the value is 2, it will kick everyone without exception!
KICK = 0

; Warnings for a simple player will receive notifications
; a - to chat
; b - at worst
; c - sound notification
NOTIFICATION = ac

; Path to warning sound beyond simple
; Both WAV and MP3 formats are supported
SAMPLE_NOTIFY = events/tutor_msg.wav

; Sound notification for a simple MP3 format
; The fact is that the MP3 format is played even if the game is minimized,
;    This way you can hint to players that they need to play or quit!
; Only MP3 format available!!
ALERT_NOTIFY = media/Half-Life01.mp3
; When a certain idle percentage is reached, this file will be played.
ALERT_PERCENT = 80

; What to do if the bomb is AFK!
; 0 - Nothing
; 1 - Throw away like a weapon
; 2 - Pass to the nearest teammate (if impossible, then use 1 option)
BOMB_TRANSFER = 0

; Do not throw away money when transferring to observation for downtime
; The game should set mp_startmoney money if the player switches to observation
MONEY_SAVE = 0

; If the remaining living players on the team are AFK:
; 0 - Do nothing!
; 1 - Report this to the chat!
; 2 - Force the round to end with a victory for the opposing team!
SCENARIO_MODE = 0

; If the online server is higher than this level, then viewers will start to get kicked for being watched for a long time
SPEC_MIN_PLAYERS = 30

; Time interval (in seconds) between each check of a player in his observation
SPEC_CHECK = 5

; Players with this flag(s) are counted separately by the plugin (see below)
SPEC_ACCESS = d

; Maximum time a player spends observing (in seconds)
; The time starts when the player connects to the server, or when entering observation mode
SPEC_MAX_TIME = 300
; For privileged players with specified access
; 0 - No time limit.
SPEC_MAX_TIME_VIP = 0

; How many seconds must remain before the player is shown a menu confirming that he is in the game?
; Use 0 to disable this feature!
SPEC_MENU_TIME_LEFT = 60

; What action will the plugin perform after the player has confirmed that he is in the game?
; 0 - Updates the player's timestamp and the counter will start from the beginning
; 1 - One confirmation is enough, then the plugin will not touch the player, he will always be in the game
; 2 - From 2 or more specified seconds of additional time to the main time. player checks (see SPEC_MAX_TIME)
SPEC_MENU_FUNCTION = 0

; Reason for kicking for simple
AFK_REASON = AFK

; Reason for kicking for long-term observation
SPEC_REASON = Big online

API

Reveal: 
Code:
#if defined _afk_control_included
  #endinput
#endif
#define _afk_control_included

/**
* Check if player is afk
*
* @param id            Player index
*
* @return              true on success, false otherwise
*/
native afkc_is_user_afk(const id);

/**
* Gets the current afk player status stage
*
* @param id            Player index
*
* @return              AFC stage as a percentage (from 0 to 100)
*/
native afkc_get_stage(id);

/**
* Instant update of the player's last activity time
*
* @note The second parameter should include local game time (func: get_gametime())
*       Use 0 to reset activity time
*
* @note The activity time is calculated for each new frame of the player
*
* @param id            Player index
* @param time          New time
*
* @return              true on success, false otherwise
*/
native afkc_update_activity(const id, Float:time = 0.0);

/**
* Сalled every new stage of the player's AFK
*
* @param id            Player index
* @param lastActivity  The last time of the player's activity
* @param stage         Current afk stage (can be overwritten)
*
* @noreturn
*/
forward afkc_stage(id, Float:lastActivity, &stage);

/**
* Called before the plugin punishes the player for AFK
*
* @note The plugin doesn't update the time of the player's last activity,
*       in case the event is blocked
*
* @param id            Player index
*
* @return      PLUGIN_CONTINUE to allow the action to happen
*              PLUGIN_HANDLED or higher to prevent this action
*/
forward afkc_action(id);

/**
* Called when the player's AFK status is switched
*
* @param id            Player index
* @param status        If true the player is AFK, false otherwise
*
* @noreturn
*/
forward afkc_toggle(id, bool:status);
Author
LALEAGANE
Downloads
32
Views
73
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LALEAGANE

shape1
shape2
shape3
shape4
shape5
shape6
Back
Top