Skip to content

Commit

Permalink
priority: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick committed Aug 21, 2020
1 parent d3b1d02 commit fdac235
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/amxmodx/configs/plugins-map_manager.ini
Expand Up @@ -9,3 +9,4 @@ map_manager_online_sorter.amxx
map_manager_effects.amxx
map_manager_informer.amxx
; map_manager_adv_lists.amxx
; map_manager_priority.amxx
29 changes: 29 additions & 0 deletions addons/amxmodx/scripting/map_manager_priority.sma
@@ -0,0 +1,29 @@
#include <amxmodx>
#include <map_manager>

#define PLUGIN "Map Manager: Priority"
#define VERSION "0.0.1"
#define AUTHOR "Mistrick"

#pragma semicolon 1

new Array:g_aMapList;

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
}

public mapm_maplist_loaded(Array:maplist, const nextmap[])
{
g_aMapList = maplist;
}

public mapm_can_be_in_votelist(const map[], type, index)
{
new map_info[MapStruct];
ArrayGetArray(g_aMapList, index, map_info);
new rnd = random_num(0, 99);

return rnd < map_info[MapPriority] ? MAP_ALLOWED : MAP_BLOCKED;
}

0 comments on commit fdac235

Please sign in to comment.