// ---------------------------------------------------------------------------
// StatsMe 2.8.3 Config Pack [16 June, 2004]
// ---------------------------------------------------------------------------
// This file is part of StatsMe (See README for more information).
// Copyright 2002 - 2004 UnitedAdmins (www.unitedadmins.com)
// Project originally created by OLO (http://olo.counter-strike.pl)
// ---------------------------------------------------------------------------
// Please read the manual and the forums carefully before altering this file!
// The Manual is located at http://docs.unitedadmins.com/statsme/
// The Forum can be found at http://forums.unitedadmins.com/
// ---------------------------------------------------------------------------
// kicks players who are away from keyboard

localinfo mafk 2 // how many rounds a player can be AFK

sm_menu "Kick AFK players\y\R{sm_mode2&b?ON:OFF}" "sm_mode2 {sm_mode2&b?remove:set} b"

sm_reg "SM_PutInServer b 2" "{%.afkc{p.id}=0}" bde
sm_reg "SM_RoundStart b 2" "{%.afk{p.id}={p.pos}}" bde
sm_reg "StatusIcon b 2" "{%.afk{p.id}=0}" bde "1=0" "2=buyzone"
sm_reg "SM_RoundEnd b 2" "{%.afk{p.id}!{p.pos}?#}{%.afkc{p.id}+1}" bde
sm_reg "SM_RoundEnd b 2" "{%.afkc{p.id}<{I.mafk}?#}sm_clexec2 #{p.uid} \'echo \\'AFK for too long.\\';disconnect\';sm_log \'{p.name}<{p.uid}><{p.authid}><{p.team}>\' AFK for too long" bde