From 21642e35590246e0185936559c9f049e7446a0de Mon Sep 17 00:00:00 2001 From: David Date: Mon, 28 Apr 2014 21:11:30 +0200 Subject: [PATCH] Added cvar to choose whether tag is enabled by default or not --- stamm_tag.sp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/stamm_tag.sp b/stamm_tag.sp index 5907b4d..ce590f0 100644 --- a/stamm_tag.sp +++ b/stamm_tag.sp @@ -38,8 +38,9 @@ new Handle:g_hTag; new Handle:g_hAdmin; +new Handle:g_hDefault; - +new bool:isLoaded = false; // Details of plugin @@ -47,7 +48,7 @@ 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" }; @@ -70,7 +71,6 @@ public OnAllPluginsLoaded() STAMM_LoadTranslation(); - STAMM_RegisterFeature("VIP Tag", true, false); } @@ -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(); @@ -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[]) {