From 7ced590cbc41654a783559b6d9ccc9a72196795f Mon Sep 17 00:00:00 2001 From: HttrckCldHKS Date: Sat, 18 Oct 2014 11:04:10 -0700 Subject: [PATCH] Improving Code --- plugins/include/amxmisc.inc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 9f91c6bb..99e7aa8d 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -422,18 +422,29 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad stock colored_menus() { - new const ModNames[][] = { "cstrike", "czero", "dmc", "dod", "tfc", "valve" }; - new ModName[32]; + static const ModNames[][] = { "cstrike", "czero", "dmc", "dod", "tfc", "valve" }; + static ColoredMenus = -1; - get_modname(ModName, charsmax(ModName)); - - for (new Iterator = 0; Iterator < sizeof(ModNames); Iterator++) + if (ColoredMenus == -1) { - if (equal(ModName, ModNames[Iterator])) - return 1; + new ModName[32]; + get_modname(ModName, charsmax(ModName)); + + for (new Iterator = 0; Iterator < sizeof(ModNames); Iterator++) + { + if (equal(ModName, ModNames[Iterator])) + { + ColoredMenus = 1; + + break; + } + } + + if (ColoredMenus == -1) + ColoredMenus = 0; } - return 0; + return ColoredMenus; } stock cstrike_running()