diff --git a/mapchooser_extended/scripting/rockthevote_extended.sp b/mapchooser_extended/scripting/rockthevote_extended.sp index bc580021..d0b3737a 100644 --- a/mapchooser_extended/scripting/rockthevote_extended.sp +++ b/mapchooser_extended/scripting/rockthevote_extended.sp @@ -39,6 +39,7 @@ #include #include #include +#include #define MCE_VERSION "1.3.0" @@ -58,6 +59,7 @@ ConVar g_Cvar_Interval; ConVar g_Cvar_ChangeTime; ConVar g_Cvar_RTVPostVoteAction; ConVar g_Cvar_RTVAutoDisable; +ConVar g_Cvar_AFKTime; bool g_CanRTV = false; // True if RTV loaded maps and is active. bool g_RTVAllowed = false; // True if RTV is available to players. Used to delay rtv votes. @@ -82,6 +84,7 @@ public void OnPluginStart() g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0); g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0); g_Cvar_RTVAutoDisable = CreateConVar("sm_rtv_autodisable", "0", "Automatically disable RTV when map time is over.", _, true, 0.0, true, 1.0); + g_Cvar_AFKTime = CreateConVar("sm_rtv_afk_time", "180", "AFK Time in seconds after which a player is not counted in the rtv ratio"); RegConsoleCmd("sm_rtv", Command_RTV); @@ -160,7 +163,7 @@ void UpdateRTV() { if (IsClientInGame(i) && !IsFakeClient(i)) { - if (GetClientTeam(i) == 2 || GetClientTeam(i) == 3) + if ((GetClientTeam(i) == 2 || GetClientTeam(i) == 3) && GetClientIdleTime(i) <= g_Cvar_AFKTime.IntValue) { g_Voters++; }