From 1c98ac05246e8390695f228596313f2ef98eb66e Mon Sep 17 00:00:00 2001 From: Mistrick Date: Sun, 8 Apr 2018 23:31:48 +0700 Subject: [PATCH] nomination: added cvar mapm_nom_type --- map_manager_nomination.sma | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/map_manager_nomination.sma b/map_manager_nomination.sma index a32d724..eea62e9 100644 --- a/map_manager_nomination.sma +++ b/map_manager_nomination.sma @@ -14,9 +14,6 @@ #define get_num(%0) get_pcvar_num(g_pCvars[%0]) -#define NOMINATED_MAPS_IN_VOTE 3 -#define NOMINATED_MAPS_PER_PLAYER 3 - #if !defined client_disconnected #define client_disconnected client_disconnect #endif @@ -27,7 +24,13 @@ enum { NOMINATION_REMOVED }; +enum { + TYPE_STANDART, + TYPE_FIXED +}; + enum Cvars { + TYPE, MAPS_IN_VOTE, MAPS_PER_PLAYER, DONT_CLOSE_MENU, @@ -48,6 +51,7 @@ public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); + g_pCvars[TYPE] = register_cvar("mapm_nom_type", "0"); // 0 - standart, 1 - fixed g_pCvars[MAPS_IN_VOTE] = register_cvar("mapm_nom_maps_in_vote", "3"); g_pCvars[MAPS_PER_PLAYER] = register_cvar("mapm_nom_maps_per_player", "3"); g_pCvars[DONT_CLOSE_MENU] = register_cvar("mapm_nom_dont_close_menu", "1"); // 0 - disable, 1 - enable @@ -137,6 +141,12 @@ nominate_map(id, map[], index) client_print_color(id, print_team_default, "%s^1 %L", PREFIX, id, "MAPM_NOM_NOT_AVAILABLE_MAP"); return NOMINATION_FAIL; } + + if(get_num(TYPE) == TYPE_FIXED && ArraySize(g_aNomList) >= get_num(MAPS_IN_VOTE)) { + // TODO: add ML + client_print_color(id, print_team_default, "%s^1 All nomination slots are reserved.", PREFIX); + return NOMINATION_FAIL; + } new nom_info[NomStruct], name[32]; get_user_name(id, name, charsmax(name));