From d89dc514eef8a936aef126833eff3a92d94f47a9 Mon Sep 17 00:00:00 2001 From: Mistrick Date: Thu, 5 Aug 2021 20:11:12 +0700 Subject: [PATCH] priority: add cvar for ignore nomination --- cstrike/addons/amxmodx/configs/map_manager.cfg | 7 +++++++ .../amxmodx/scripting/map_manager_priority.sma | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cstrike/addons/amxmodx/configs/map_manager.cfg b/cstrike/addons/amxmodx/configs/map_manager.cfg index d1e3023..b5b20a8 100644 --- a/cstrike/addons/amxmodx/configs/map_manager.cfg +++ b/cstrike/addons/amxmodx/configs/map_manager.cfg @@ -208,3 +208,10 @@ mapm_block_voice "1" // // 0 - disable, 1 - enable, 2 - force use flags mapm_freeze_in_vote "1" + + +// Priority + +// Игнорировать приоритеты для номированных карт. +// 0 - disable, 1 - enable +mapm_priority_ignore_nomination "1" diff --git a/cstrike/addons/amxmodx/scripting/map_manager_priority.sma b/cstrike/addons/amxmodx/scripting/map_manager_priority.sma index 7fd3a1a..99363cb 100644 --- a/cstrike/addons/amxmodx/scripting/map_manager_priority.sma +++ b/cstrike/addons/amxmodx/scripting/map_manager_priority.sma @@ -2,16 +2,25 @@ #include #define PLUGIN "Map Manager: Priority" -#define VERSION "0.0.1" +#define VERSION "0.0.2" #define AUTHOR "Mistrick" #pragma semicolon 1 +#define get_num(%0) get_pcvar_num(g_pCvars[%0]) + +enum Cvars { + IGNORE_NOMINATION +}; + +new g_pCvars[Cvars]; new Array:g_aMapList; public plugin_init() { register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR); + + g_pCvars[IGNORE_NOMINATION] = register_cvar("mapm_priority_ignore_nomination", "1"); } public mapm_maplist_loaded(Array:maplist, const nextmap[]) @@ -21,6 +30,10 @@ public mapm_maplist_loaded(Array:maplist, const nextmap[]) public mapm_can_be_in_votelist(const map[], type, index) { + if(type == PUSH_BY_NOMINATION && get_num(IGNORE_NOMINATION)) { + return MAP_ALLOWED; + } + new map_info[MapStruct]; ArrayGetArray(g_aMapList, index, map_info); new rnd = random_num(0, 99);