Permalink
Browse files

Add error log + unload fake+invisible name items

when mp_playerid isn't 2
  • Loading branch information...
Bara committed Oct 23, 2018
1 parent 53344f8 commit f29de08ef21fb11da1c4c5eddf84e2f318ffb36c
Showing with 13 additions and 0 deletions.
  1. +13 −0 addons/sourcemod/scripting/ttt/ttt_fakename.sp
@@ -76,6 +76,15 @@ public void OnPluginStart()
public void OnConfigsExecuted()
{
ConVar cvar = FindConVar("mp_playerid");
if (cvar.IntValue != 2)
{
LogError("Fake Name and Invisible Name requires \"mp_playerid 2\". Both items has been unloaded!");
TTT_RemoveCustomItem(SHORT_NAME);
TTT_RemoveCustomItem(SHORT_NAME_INVI);
}
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
@@ -277,5 +286,9 @@ bool CheckPlayerID()
return true;
}
LogError("Fake Name and Invisible Name requires \"mp_playerid 2\". Both items has been unloaded!");
TTT_RemoveCustomItem(SHORT_NAME);
TTT_RemoveCustomItem(SHORT_NAME_INVI);
return false;
}

0 comments on commit f29de08

Please sign in to comment.