Skip to content

Commit d89dc51

Browse files
committed
priority: add cvar for ignore nomination
1 parent 0c4bd4a commit d89dc51

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

cstrike/addons/amxmodx/configs/map_manager.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,10 @@ mapm_block_voice "1"
208208
//
209209
// 0 - disable, 1 - enable, 2 - force use flags
210210
mapm_freeze_in_vote "1"
211+
212+
213+
// Priority
214+
215+
// Игнорировать приоритеты для номированных карт.
216+
// 0 - disable, 1 - enable
217+
mapm_priority_ignore_nomination "1"

cstrike/addons/amxmodx/scripting/map_manager_priority.sma

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
#include <map_manager>
33

44
#define PLUGIN "Map Manager: Priority"
5-
#define VERSION "0.0.1"
5+
#define VERSION "0.0.2"
66
#define AUTHOR "Mistrick"
77

88
#pragma semicolon 1
99

10+
#define get_num(%0) get_pcvar_num(g_pCvars[%0])
11+
12+
enum Cvars {
13+
IGNORE_NOMINATION
14+
};
15+
16+
new g_pCvars[Cvars];
1017
new Array:g_aMapList;
1118

1219
public plugin_init()
1320
{
1421
register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR);
22+
23+
g_pCvars[IGNORE_NOMINATION] = register_cvar("mapm_priority_ignore_nomination", "1");
1524
}
1625

1726
public mapm_maplist_loaded(Array:maplist, const nextmap[])
@@ -21,6 +30,10 @@ public mapm_maplist_loaded(Array:maplist, const nextmap[])
2130

2231
public mapm_can_be_in_votelist(const map[], type, index)
2332
{
33+
if(type == PUSH_BY_NOMINATION && get_num(IGNORE_NOMINATION)) {
34+
return MAP_ALLOWED;
35+
}
36+
2437
new map_info[MapStruct];
2538
ArrayGetArray(g_aMapList, index, map_info);
2639
new rnd = random_num(0, 99);

0 commit comments

Comments
 (0)