Skip to content

Commit

Permalink
priority: add cvar for ignore nomination
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick committed Aug 5, 2021
1 parent 0c4bd4a commit d89dc51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cstrike/addons/amxmodx/configs/map_manager.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
15 changes: 14 additions & 1 deletion cstrike/addons/amxmodx/scripting/map_manager_priority.sma
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
#include <map_manager>

#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[])
Expand All @@ -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);
Expand Down

0 comments on commit d89dc51

Please sign in to comment.