rtv: adjustement cause of changes in ZombieManager
since we have more afk's in teams now, we shouldnt count them for rtv ratio
This commit is contained in:
		
							parent
							
								
									4f947fdec6
								
							
						
					
					
						commit
						27631bb256
					
				@ -39,6 +39,7 @@
 | 
				
			|||||||
#include <sdktools_functions>
 | 
					#include <sdktools_functions>
 | 
				
			||||||
#include <mapchooser>
 | 
					#include <mapchooser>
 | 
				
			||||||
#include <nextmap>
 | 
					#include <nextmap>
 | 
				
			||||||
 | 
					#include <AFKManager>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MCE_VERSION "1.3.0"
 | 
					#define MCE_VERSION "1.3.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -58,6 +59,7 @@ ConVar g_Cvar_Interval;
 | 
				
			|||||||
ConVar g_Cvar_ChangeTime;
 | 
					ConVar g_Cvar_ChangeTime;
 | 
				
			||||||
ConVar g_Cvar_RTVPostVoteAction;
 | 
					ConVar g_Cvar_RTVPostVoteAction;
 | 
				
			||||||
ConVar g_Cvar_RTVAutoDisable;
 | 
					ConVar g_Cvar_RTVAutoDisable;
 | 
				
			||||||
 | 
					ConVar g_Cvar_AFKTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool g_CanRTV = false;			// True if RTV loaded maps and is active.
 | 
					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.
 | 
					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_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_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_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);
 | 
						RegConsoleCmd("sm_rtv", Command_RTV);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -160,7 +163,7 @@ void UpdateRTV()
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		if (IsClientInGame(i) && !IsFakeClient(i))
 | 
							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++;
 | 
									g_Voters++;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user