Permalink
Browse files

Make convar as global convar

Thanks @c0rp3n
  • Loading branch information...
Bara committed Jun 14, 2018
1 parent 88bfe9f commit 19da87f70372c13f9cd9c1d0e61268e5feea1cfa
Showing with 8 additions and 4 deletions.
  1. +8 −4 addons/sourcemod/scripting/ttt/ttt_overlay.sp
@@ -40,6 +40,7 @@ ConVar g_cColorD = null;
ConVar g_cColorI = null;
ConVar g_cColorT = null;
ConVar g_cUpdateTeamScore = null;
ConVar g_cSeeRole = null;
bool g_bEndOverlay = false;
@@ -160,6 +161,11 @@ public void OnMapStart()
g_iTWin = 0;
}
public void OnAllPluginsLoaded()
{
g_cSeeRole = FindConVar("ttt_dead_players_can_see_other_roles");
}
public Action Event_RoundStartPre(Event event, const char[] name, bool dontBroadcast)
{
TTT_ShowOverlayToAll(" ");
@@ -312,11 +318,9 @@ public void AssignOverlay(int client, int role)
TTT_ShowOverlayToClient(client, " ");
}
ConVar cvar = FindConVar("ttt_dead_players_can_see_other_roles");
if (cvar != null)
if (g_cSeeRole != null)
{
if (cvar.BoolValue && !TTT_IsPlayerAlive(client))
if (g_cSeeRole.BoolValue && !TTT_IsPlayerAlive(client))
{
int iMode = GetEntProp(client, Prop_Send, "m_iObserverMode");

0 comments on commit 19da87f

Please sign in to comment.