Участник
Пользователь
- Сообщения
- 290
- Реакции
- 28
- Помог
- 2 раз(а)
- Ошибка
-
Other maps in vote
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5271 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jun 24 2020 13:53:30
Built from: https://github.com/alliedmodders/amxmodx/commit/5eea3e5
Build ID: 5271:5eea3e5
Core mode: JIT+ASM32
- Билд
-
ReHLDS version: 3.8.0.711-dev
Build date: 13:13:38 Feb 6 2021 (2492)
Build from: https://github.com/dreamstalker/rehlds/commit/722e19d
- ReGamedll
-
ReGameDLL version: 5.20.0.516-dev
Build date: 21:01:56 Jun 14 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2c52c4f
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.137 ini Start Never
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] AuthEmu RUN - authemu_amxx_i386.so v5.2.12.425-dev pl5 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.19.0.217-dev pl5 ANY Never
[11] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[12] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[17] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[18] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[19] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
19 plugins, 19 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Voice Chat 0.3 mx?! admin_voice_cha running
[ 2] Colored Flashbangs 1.0 v3x colored_flashba running
[ 3] Chat Logger 2.1a Jim chat_logger_nez running
[ 4] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 5] WebHS 0.1 kanagava fb_web_online.a running
[ 6] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 7] Auto Join on Connect 0.1 VEN auto_join_on_co running
[ 8] [190] Cvar On Map 20.06.06 SKAJIbnEJIb cvar_on_map.amx running
[ 9] ChatAdditions: Core v1.7.2 Sergey Shorokhov ChatAdditions_C running
[ 10] CA: Gag v1.7.2 Sergey Shorokhov CA_Gag.amxx running
[ 11] CA: Mute v1.7.2 Sergey Shorokhov CA_Mute.amxx running
[ 12] ChatAdditions: CSBans v1.7.2 Sergey Shorokhov CA_Storage_CSBa running
[ 13] [SQL] Chat Manager 1.1.1-13 Mistrick chatmask.amxx running
[ 14] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 15] [ReAPI] Anti overflow 1.0 Some Author antioverflow.am running
[ 16] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 17] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 18] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 19] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 20] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 21] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 22] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 23] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 24] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 25] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 26] Access Manager 1.0.0 mx?! AccessManager.a running
[ 27] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 28] Lista admini (amx_who) cs.leaguec Kobra whobun.amxx running
[ 29] unknown unknown unknown flash.amxx running
[ 30] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 31] Unlimited Choose Team 1.0 Javekson unlimited_choos running
[ 32] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 33] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 34] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 35] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 36] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 37] Players Menu 1.7 neugomon players_menu.am debug
[ 38] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 39] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 40] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 41] OciXCrom's Admin Chat 4.2 OciXCrom crx_adminchat.a running
[ 42] Private Message: Core 1.5 Denzer private_message running
[ 43] Private Message: Loggi 1.3 Denzer private_message running
[ 44] Items Restrict 1.1 s1lent items_restrict. running
[ 45] Server Menu 1.5.0 F@nt0M server_menu.amx running
[ 46] Advanced Spam Nick Cha 0.2 Fullserver advanced_spam_n running
[ 47] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 48] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 49] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 50] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 51] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 52] unknown unknown unknown fake.amxx running
[ 53] CS AFK Manager 1.0.6 (amx Freeman afk_manager_1-8 running
[ 54] unknown unknown unknown pingfakeoutstan running
[ 55] Ultimele Harti 1.0 M@$t3r_@dy harti.amxx running
[ 56] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 57] Admin Commands Log 1.2 w0w admin_commands_ running
[ 58] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 59] Reklama 09.07.2019 mx?! reklama.amxx running
[ 60] [190] Warmup RBS 20.08.08 SKAJIbnEJIb warmup_rbs.amxx running
[ 61] [190] Ultimate Flags 20.06.06 SKAJIbnEJIb ultimate_flags. running
[ 62] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 63] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 64] Check Vip 2.0 Leo_[BH] check.amxx running
[ 65] Map Manager: Core 3.0.10 Mistrick map_manager_cor running
[ 66] Map Manager: Scheduler 0.1.7 Mistrick map_manager_sch running
[ 67] Map Manager: Nominatio 0.1.3 Mistrick map_manager_nom running
[ 68] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 69] Map Manager: Online so 0.0.3 Mistrick map_manager_onl running
[ 70] Map Manager: Effects 0.0.10 Mistrick map_manager_eff running
[ 71] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 72] Map Manager: Advanced 0.0.7 Mistrick map_manager_adv running
[ 73] Map Manager: Online ch 1.0.0 Sergey Shorokhov map_manager_onl running
[ 74] Admin Mapmenu 0.5.3 d3m37r4 admin_mapmenu.a running
[ 75] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 76] Admin/VIP No FallDamag 0.0.1 ConnorMcLeod nofalldamage.am running
[ 77] Hide 1.1 xPaw hidexpaw.amxx running
[ 78] M_AntiRusher 2.83 Miczu xPaw_Antirusher running
[ 79] Say Me And HP 1.0 Javekson say_me_hp.amxx running
[ 80] Save score & money 1.2.4 Minni Mouse Save_Score_and_ running
[ 81] Hostname Timeleft 1.0 xPaw HostnameTimelef running
[ 82] [ReAPI] Block 'Fire in 0.0.1 sergrib simpleblockfith running
[ 83] Admins Only 1.0 Andy staffonly.amxx running
[ 84] Write MS 0.1 ill log_ms.amxx running
[ 85] Advanced Kill Assists 1.3c Xelson next21_kill_ass debug
[ 86] Top Awards 0.2cx Safety1st top_awards2.amx running
[ 87] Killer ScreenFade 0.0.6 Vaqtincha killer_screenfa running
[ 88] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 89] Online Logger 1.0.3 mx?! online_logger.a running
[ 90] DemoRecoder 1.1 neygomon amx_demorec.amx running
[ 91] [ReAPI] VIP System 1.3.1 pUzzlik re_vip_system.a running
[ 92] 49 44 49 20 4E 41 58 59 49 ausermsg.amxx running
[ 93] Wasted Time 1.3.0 Javekson wasted_time.amx debug
[ 94] Maps Online 1.0 Javekson maps_online.amx running
[ 95] Mode 2x2 2.5re s1lent mode.amxx running
[ 96] Bet 2.2 Filip Vilicic bet.amxx running
[ 97] Style C4 Timer 3.0 OciXCrom crx_c4timer.amx running
[ 98] [190] Stimulation RBS 20.06.06 SKAJIbnEJIb stimulation_rbs running
[ 99] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[100] Steam Bonus 1.1 ill+F@nToM steam_bonus_a2. running
[101] [ReAPI] Silly C4 2.0 F@ntoM & Cheap_S reapi_sillyc4_2 running
101 plugins, 101 running
- Автор плагина
- d3m37r4
- Версия плагина
- 0.5.3
- Исходный код
-
#include <amxmodx>
#include <map_manager>
#include <map_manager_scheduler>
new const ADMIN_MAPLIST[] = "admin_maps.ini"; // Map list for menu formation (only map name is indicated in line, without indicating online)
const FLAG_ACCESS_CHANGEMAP = ADMIN_MAP; // Flag for access to map change commands
const FLAG_ACCESS_VOTEMAP = ADMIN_VOTE; // Flag for access to commands for creating a vote for a map change
const VOTE_BY_ADMIN_MENU = 4;
const MAX_ITEMS_MENU = 6;
enum {
MenuKeyConfirm = 6,
MenuKeyBack,
MenuKeyNext,
MenuKeyExit
};
enum {
ChangeMapMenu,
VoteMapMenu
};
enum InfoList {
MenuType,
MenuPos,
MenuId,
MenuUserId
};
enum StateType {
StateNone = -1,
StateSelect
};
enum CvarList {
Delay,
}
new Array:g_MapList, Array:g_VoteList, Array:g_MainMapList;
new g_LoadedMaps, g_VoteItems;
new g_MenuInfo[InfoList];
new StateType:g_State = StateNone;
new g_EventNewRound;
new g_LastRound;
new g_NextMap[MAPNAME_LENGTH];
new g_Prefix[48];
new g_Cvar[CvarList];
new g_MapStartTime;
#if AMXX_VERSION_NUM < 200
new MapName[MAPNAME_LENGTH];
#endif
public plugin_init() {
register_plugin("Admin Mapmenu", "0.5.3", "d3m37r4");
RegisterCmd();
RegisterBlockCmd();
bind_pcvar_num(create_cvar(
.name = "mapm_mapmenu_delay",
.string = "0",
.flags = FCVAR_SERVER,
.has_min = true,
.min_val = 0.0)
, g_Cvar[Delay]);
register_dictionary("admin_mapmenu.txt");
if(register_dictionary("mapmanager.txt") != -1) {
set_fail_state("failed to open dictionary file 'mapmanager.txt', check its availability");
}
register_menucmd(g_MenuInfo[MenuId] = register_menuid("MapMenu"), 1023, "HandleMapMenu");
disable_event(g_EventNewRound = register_event("HLTV", "EventNewRound", "a", "1=0", "2=0"));
#if AMXX_VERSION_NUM < 200
get_mapname(MapName, charsmax(MapName));
#endif
g_MapStartTime = get_systime();
}
public plugin_cfg() {
g_MapList = ArrayCreate(MAPNAME_LENGTH);
g_VoteList = ArrayCreate(MAPNAME_LENGTH);
new filename[32];
copy(filename, charsmax(filename), ADMIN_MAPLIST);
if(!mapm_load_maplist_to_array(g_MapList, filename)) {
ArrayDestroy(g_MapList);
ArrayDestroy(g_VoteList);
set_fail_state("nothing loaded from '%s'", filename);
}
if(g_MapList) {
g_LoadedMaps = ArraySize(g_MapList);
}
bind_pcvar_num(get_cvar_pointer("mapm_last_round"), g_LastRound);
mapm_get_prefix(g_Prefix, charsmax(g_Prefix));
}
public CmdSay(const id) {
if(!is_vote_started() && !is_vote_finished() && !is_vote_will_in_next_round()) {
return PLUGIN_CONTINUE;
}
new text[MAPNAME_LENGTH]; read_args(text, charsmax(text));
remove_quotes(text); trim(text); strtolower(text);
if(is_string_with_space(text)) {
return PLUGIN_CONTINUE;
}
new bool:nomination = false;
new map_index = mapm_get_map_index(text);
if(map_index != INVALID_MAP_INDEX) {
nomination = true;
} else if(strlen(text) >= 4) {
map_index = __FindSimilarMapByString(text, g_MainMapList);
if(map_index != INVALID_MAP_INDEX ) {
nomination = true;
}
}
if(nomination) {
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public CmdBlock(const id) {
if(is_vote_started() || is_vote_finished() || is_vote_will_in_next_round()) {
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public CmdChangeMap(const id, const flags) {
if(!CmdEnabled(id, flags, true)) {
return PLUGIN_HANDLED;
}
if(read_argc() != 2) {
console_print(id, "%l", "INVALID_CMD_SYNTAX");
console_print(id, "%l: amx_changemap <map>", "USAGE_EXAMPLE");
return PLUGIN_HANDLED;
}
new map[MAPNAME_LENGTH];
read_argv(1, map, charsmax(map));
if(equali(map, MapName)) {
console_print(id, "%l!", "ERR_THIS_CURR_MAP");
return PLUGIN_HANDLED;
}
if(!MapInArray(map, g_MainMapList) && !MapInArray(map, g_MapList)) {
console_print(id, "%l", "ERR_NO_IN_MAPLIST", map);
return PLUGIN_HANDLED;
}
ChangeMap(id, map);
return PLUGIN_HANDLED;
}
public CmdVoteMap(const id, const flags) {
if(!CmdEnabled(id, flags, true)) {
return PLUGIN_HANDLED;
}
new argc = read_argc();
new max_items = mapm_get_votelist_size();
if(argc < 2 || max_items + 1 < argc) {
console_print(id, "%l", "INVALID_CMD_SYNTAX");
console_print(id, "%l: %d", "MAX_ITEMS_IN_VOTE", max_items);
console_print(id, "%l: amx_votemap <map1> <map2> ...", "USAGE_EXAMPLE");
return PLUGIN_HANDLED;
}
g_VoteItems = 0;
max_items = (argc - 1);
for(new i, map[MAPNAME_LENGTH]; i < max_items; i++) {
read_argv(i + 1, map, charsmax(map));
if(map[0] == EOS) {
continue;
}
if(equali(map, MapName)) {
console_print(id, "%l (arg #%d)!", "ERR_THIS_CURR_MAP", i + 1);
continue;
}
if(!MapInArray(map, g_MainMapList) && !MapInArray(map, g_MapList)) {
console_print(id, "%l (arg #%d)!", "ERR_NO_IN_MAPLIST", map, i + 1);
continue;
}
if(MapInArray(map, g_VoteList)) {
console_print(id, "%l (arg #%d)!", "ERR_MAP_DUPLICATED", map, i + 1);
continue;
}
ArrayPushString(g_VoteList, map);
g_VoteItems++;
}
if(g_VoteItems) {
StartVote(id);
} else {
console_print(id, "%l", "ERR_VOTE_FAILED");
}
return PLUGIN_HANDLED;
}
public CmdChangeMapMenu(const id, const flags) {
if(!CmdEnabled(id, flags)) {
return PLUGIN_HANDLED;
}
OpenMapMenu(id, ChangeMapMenu);
return PLUGIN_HANDLED;
}
public CmdVoteMapMenu(const id, const flags) {
if(!CmdEnabled(id, flags)) {
return PLUGIN_HANDLED;
}
OpenMapMenu(id, VoteMapMenu);
return PLUGIN_HANDLED;
}
OpenMapMenu(const id, const menuid) {
if(g_State == StateSelect) {
new bool:menu_open, menu_index, dummy;
for(new player = 1; player <= MaxClients; player++) {
if(!is_user_connected(player)) {
continue;
}
player_menu_info(player, menu_index, dummy);
if(g_MenuInfo[MenuId] != menu_index) {
continue;
}
menu_open = true;
break;
}
if(!menu_open) {
ClearData();
}
}
if(g_State == StateNone) {
g_MenuInfo[MenuPos] = 0;
g_MenuInfo[MenuType] = menuid;
g_MenuInfo[MenuUserId] = id;
g_State = StateSelect;
ShowMapMenu(id);
}
}
ShowMapMenu(const id, const page = 0) {
new start, end;
new current = GetMenuPage(page, g_LoadedMaps, MAX_ITEMS_MENU, start, end);
new pages = GetMenuPagesNum(g_LoadedMaps, MAX_ITEMS_MENU);
new max_items = g_MenuInfo[MenuType] == VoteMapMenu ? mapm_get_votelist_size() : 1;
SetGlobalTransTarget(id);
new menu[MAX_MENU_LENGTH];
new len = formatex(menu, charsmax(menu), "%l", g_MenuInfo[MenuType] == VoteMapMenu ? "VOTEMAP_MENU_TITLE" : "CHANGEMAP_MENU_TITLE");
len += formatex(menu[len], charsmax(menu) - len, " \y%d/%d^n", current + 1, pages + 1);
len += formatex(menu[len], charsmax(menu) - len, "%l \y%d/%d^n^n", "SELECTED_MAPS", g_VoteItems, max_items);
new keys = MENU_KEY_0;
for(new i = start, item, map_name[MAPNAME_LENGTH]; i < end; i++) {
ArrayGetString(g_MapList, i, map_name, charsmax(map_name));
keys |= (1 << item);
len += formatex(menu[len], charsmax(menu) - len, MapInArray(map_name, g_VoteList) ?
"\d%d. %s \y[\r*\y]^n" : "\r%d. \w%s^n", ++item, map_name);
}
new tmp[15];
setc(tmp, MAX_ITEMS_MENU - (end - start) + 1, '^n');
len += copy(menu[len], charsmax(menu) - len, tmp);
if(g_VoteItems) {
keys |= MENU_KEY_7;
len += formatex(menu[len], charsmax(menu) - len, "\r7. \w%l^n", g_MenuInfo[MenuType] == VoteMapMenu ?
"MENUKEY_CREATE_VOTE" : "MENUKEY_CONFIRM_SELECTION");
} else {
len += formatex(menu[len], charsmax(menu) - len, "\d7. %l^n", g_MenuInfo[MenuType] == VoteMapMenu ?
"MENUKEY_CREATE_VOTE" : "MENUKEY_CONFIRM_SELECTION");
}
if(g_MenuInfo[MenuPos] != 0) {
keys |= MENU_KEY_8;
len += formatex(menu[len], charsmax(menu) - len, "^n\r8. \w%l", "MAPM_MENU_BACK");
} else {
len += formatex(menu[len], charsmax(menu) - len, "^n\d8. %l", "MAPM_MENU_BACK");
}
if(end < g_LoadedMaps) {
keys |= MENU_KEY_9;
len += formatex(menu[len], charsmax(menu) - len, "^n\r9. \w%l", "MAPM_MENU_NEXT");
} else {
len += formatex(menu[len], charsmax(menu) - len, "^n\d9. %l", "MAPM_MENU_NEXT");
}
formatex(menu[len], charsmax(menu) - len, "^n\r0. \w%l", "MAPM_MENU_EXIT");
show_menu(id, keys, menu, -1, "MapMenu");
}
public HandleMapMenu(const id, const key) {
new max_items = g_MenuInfo[MenuType] == VoteMapMenu ? mapm_get_votelist_size() : 1;
switch(key) {
case MenuKeyConfirm: {
if(g_MenuInfo[MenuType] == VoteMapMenu) {
StartVote(id);
} else {
ArrayGetString(g_VoteList, 0, g_NextMap, charsmax(g_NextMap));
ChangeMap(id, g_NextMap);
}
}
case MenuKeyBack: {
ShowMapMenu(id, --g_MenuInfo[MenuPos]);
}
case MenuKeyNext: {
ShowMapMenu(id, ++g_MenuInfo[MenuPos]);
}
case MenuKeyExit: {
ClearData();
}
default: {
new map_name[MAPNAME_LENGTH];
ArrayGetString(g_MapList, g_MenuInfo[MenuPos] * MAX_ITEMS_MENU + key, map_name, charsmax(map_name));
new map_index = ArrayFindString(g_VoteList, map_name);
if(map_index == INVALID_MAP_INDEX) {
if(g_VoteItems != max_items) {
ArrayPushString(g_VoteList, map_name);
g_VoteItems++;
}
} else {
ArrayDeleteItem(g_VoteList, map_index);
g_VoteItems--;
}
ShowMapMenu(id, g_MenuInfo[MenuPos]);
}
}
}
public EventNewRound() {
client_print_color(0, print_team_default, "%s %l ^4%s^1.", g_Prefix, "MAPM_NEXTMAP", g_NextMap);
intermission();
}
public mapm_maplist_loaded(Array:maplist) {
g_MainMapList = ArrayClone(maplist);
}
public mapm_prepare_votelist(type) {
if(type != VOTE_BY_ADMIN_MENU) {
return;
}
for(new i, map_name[MAPNAME_LENGTH]; i < g_VoteItems; i++) {
ArrayGetString(g_VoteList, i, map_name, charsmax(map_name));
mapm_push_map_to_votelist(map_name, PUSH_BY_NATIVE, CHECK_IGNORE_MAP_ALLOWED);
}
mapm_set_votelist_max_items(g_VoteItems);
ClearData();
}
bool:CmdEnabled(const index, const flags, bool:console = false) {
if(~get_user_flags(index) & flags) {
console_print(index, "%l", "ERR_ACCESS_DENIED");
return false;
}
static message[190];
new delay = g_Cvar[Delay] * 60 - (get_systime() - g_MapStartTime);
if(delay > 0) {
console ? __ConsolePrintEx(index, "* %l", "DELAY_CMD", delay / 60, delay % 60) :
client_print_color(index, print_team_default, "%s %l", g_Prefix, "DELAY_CMD", delay / 60, delay % 60);
return false;
}
if(is_vote_started()) {
console ? __ConsolePrintEx(index, "* %l", "VOTE_STARTED") : client_print_color(index, print_team_default, "%s %l", g_Prefix, "VOTE_STARTED");
return false;
}
if(is_vote_will_in_next_round()) {
console ? __ConsolePrintEx(index, "* %l", "VOTE_IN_NEXT_ROUND") : client_print_color(index, print_team_default, "%s %l", g_Prefix, "VOTE_IN_NEXT_ROUND");
return false;
}
if(is_last_round()) {
get_cvar_string("amx_nextmap", g_NextMap, charsmax(g_NextMap));
console ? __ConsolePrintEx(index, "* %l", "MAP_DEFINED", g_NextMap) :
client_print_color(index, print_team_default, "%s %l", g_Prefix, "MAP_DEFINED", g_NextMap);
return false;
}
if(g_State == StateSelect && g_MenuInfo[MenuUserId] != index) {
new name[MAX_NAME_LENGTH];
get_user_name(g_MenuInfo[MenuUserId], name, charsmax(name));
formatex(message, charsmax(message), "%l", "MENU_STATE_SELECT",
g_MenuInfo[MenuUserId] ? name : "Server", g_MenuInfo[MenuType] == VoteMapMenu ? "MAPS" : "MAP");
console ? __ConsolePrintEx(index, "* %s", message) : client_print_color(index, print_team_default, "%s %s", g_Prefix, message);
return false;
}
return true;
}
ChangeMap(const index, map[]) {
new name[MAX_NAME_LENGTH];
get_user_name(index, name, charsmax(name));
copy(g_NextMap, charsmax(g_NextMap), map);
set_cvar_string("amx_nextmap", g_NextMap);
client_print_color(0, print_team_default, "%s %l", g_Prefix, "STATE_CHANGELEVEL", index ? name : "Server", g_NextMap);
if(g_LastRound) {
enable_event(g_EventNewRound);
client_print_color(0, print_team_default, "%s %l", g_Prefix, "MAPM_CHANGELEVEL_NEXTROUND");
} else {
intermission();
}
log_amx("Map change was started by %n", index);
}
StartVote(const index) {
new name[MAX_NAME_LENGTH];
get_user_name(index, name, charsmax(name));
client_print_color(0, print_team_default, "%s %l", g_Prefix, "STATE_CREATE_VOTE", index ? name : "Server");
map_scheduler_start_vote(VOTE_BY_ADMIN_MENU);
log_amx("Map change vote was created by %n", index);
}
RegisterCmd() {
register_concmd("amx_changemap", "CmdChangeMap", FLAG_ACCESS_CHANGEMAP);
register_clcmd("amx_changemap_menu", "CmdChangeMapMenu", FLAG_ACCESS_CHANGEMAP);
register_concmd("amx_votemap", "CmdVoteMap", FLAG_ACCESS_VOTEMAP);
register_clcmd("amx_votemap_menu", "CmdVoteMapMenu", FLAG_ACCESS_VOTEMAP);
}
RegisterBlockCmd() {
register_clcmd("say", "CmdSay");
register_clcmd("say_team", "CmdSay");
register_clcmd("say rtv", "CmdBlock");
register_clcmd("say /rtv", "CmdBlock");
register_clcmd("say maps", "CmdBlock");
register_clcmd("say /maps", "CmdBlock");
}
GetMenuPage(cur_page, elements_num, per_page, &start, &end) {
new max = min(cur_page * per_page, elements_num);
start = max - (max % MAX_ITEMS_MENU);
end = min(start + per_page, elements_num);
return start / per_page;
}
GetMenuPagesNum(elements_num, per_page) {
return (elements_num - 1) / per_page;
}
ClearData() {
g_State = StateNone;
g_VoteItems = 0;
g_NextMap[0] = EOS;
g_MenuInfo[MenuUserId] = 0;
ArrayClear(g_VoteList);
}
__FindSimilarMapByString(string[MAPNAME_LENGTH], Array:maplist) {
if(maplist == Invalid_Array) {
return INVALID_MAP_INDEX;
}
new map_info[MapStruct], end = ArraySize(maplist);
for(new i; i < end; i++) {
ArrayGetArray(maplist, i, map_info);
if(containi(map_info[Map], string) != -1) {
return i;
}
}
return INVALID_MAP_INDEX;
}
bool:MapInArray(map[], Array:arr) {
return bool:(ArrayFindString(arr, map) != INVALID_MAP_INDEX);
}
stock __ConsolePrintEx(const index, const message[], any:...) {
static _string[126];
vformat(_string, charsmax(_string), message, 3);
static const color_tags[][] = { "^1", "^3", "^4" };
for(new i; i < sizeof color_tags; i++) {
replace_string(_string, charsmax(_string), color_tags[i], "", false);
}
console_print(index, _string);
}
I use mapmanager modular of Mistrick and needed this plugin to work aswell but sadly it doesn't as intended on my server. When I call the vote as an admin through this plugin (I select 3 maps and start admin vote) the plugin starts a vote with other maps than the ones I chose.