Skip to content

Commit

Permalink
Added cvar to choose whether tag is enabled by default or not
Browse files Browse the repository at this point in the history
  • Loading branch information
dordnung committed Apr 28, 2014
1 parent 2ef5013 commit 21642e3
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions stamm_tag.sp
Expand Up @@ -38,16 +38,17 @@

new Handle:g_hTag;
new Handle:g_hAdmin;
new Handle:g_hDefault;


new bool:isLoaded = false;


// Details of plugin
public Plugin:myinfo =
{
name = "Stamm Feature VIP Tag",
author = "Popoklopsi",
version = "1.4.1",
version = "1.4.2",
description = "Give VIP's a VIP Tag",
url = "https://forums.alliedmods.net/showthread.php?t=142073"
};
Expand All @@ -70,7 +71,6 @@ public OnAllPluginsLoaded()


STAMM_LoadTranslation();
STAMM_RegisterFeature("VIP Tag", true, false);
}


Expand All @@ -95,6 +95,7 @@ public OnPluginStart()
AutoExecConfig_SetCreateFile(true);

g_hTag = AutoExecConfig_CreateConVar("tag_text", "*VIP*", "Stamm Tag");
g_hDefault = AutoExecConfig_CreateConVar("tag_default", "0", "1=Tag is enabled by default, 0=Players have to activate it at first");
g_hAdmin = AutoExecConfig_CreateConVar("tag_admin", "1", "1=Admins get also tag, 0=Off");

AutoExecConfig_CleanFile();
Expand All @@ -107,6 +108,20 @@ public OnPluginStart()



// Configs loaded
public OnConfigsExecuted()
{
if (!isLoaded)
{
isLoaded = true;

STAMM_RegisterFeature("VIP Tag", true, GetConVarBool(g_hDefault));
}
}




// Add auto updater
public STAMM_OnFeatureLoaded(const String:basename[])
{
Expand Down

0 comments on commit 21642e3

Please sign in to comment.