Скриптер
Проверенный
Пользователь
- Сообщения
- 3,593
- Реакции
- 1,576
- Помог
- 141 раз(а)
- Ошибка
-
L 08/08/2019 - 05:59:24: Invalid array handle provided (0)
L 08/08/2019 - 05:59:24: [AMXX] Displaying debug trace (plugin "map_manager_nomination.amxx", version "0.1.2")
L 08/08/2019 - 05:59:24: [AMXX] Run time error 10: native error (native "ArraySize")
L 08/08/2019 - 05:59:24: [AMXX] [0] map_manager_nomination.sma::find_similar_map (line 498)
L 08/08/2019 - 05:59:24: [AMXX] [1] map_manager_nomination.sma::clcmd_say (line 166)
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5377 (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 19 2019 13:38:50
Built from: https://github.com/alliedmodders/amxmodx/commit/5a257a7
Build ID: 5377:5a257a7
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.6.0.672-dev
Build date: 17:31:06 Jun 5 2019 (1880)
Build from: https://github.com/dreamstalker/rehlds/commit/0c8d3d7
- ReGamedll
-
ReGameDLL version: 5.9.0.362-dev
Build date: 20:19:32 Jun 21 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/b669a39
- Версия 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.133 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.32 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5377 ini Start ANY
[ 6] MySQL RUN - mysql_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[ 7] SQLite RUN - sqlite_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[ 8] Fun RUN - fun_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[11] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.9.0.171-dev pl5 ANY Never
[14] GeoIP RUN - geoip_amxx_i386.so v1.10.0.5377 pl5 ANY ANY
[15] whois RUN - whois_amxx_i386.so v0.2.270 pl5 ANY ANY
[16] CURL AMXX RUN - curl_amxx_i386.so v1.1.1 pl5 ANY ANY
16 plugins, 16 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 2] WebHS 0.1 kanagava fb_web_online.a running
[ 3] FreshBans 1.4.0b kanagava fresh_bans_140_ running
[ 4] SF Warn Menu 0.1.4g_edi serfreeman1337/N sf_admin_warns. running
[ 5] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 6] Rank Menu 1.1 h1k3 rankmenu.amxx running
[ 7] AES: StatsX 0.5 Vega serfreeman1337 statsx_cstrike. running
[ 8] Multi-Rendering System [ReAPI] 0. Subb98/Nordic Wa multirendering. running
[ 9] Admin menu central 0.2 Nordic Warrior adminmenu_centr running
[ 10] Admin Load 3.10.0 F@nt0M adminload.amxx running
[ 11] Admin Commands 1.10.0.537 AMXX Dev Team admincmd.amxx running
[ 12] Admin Help 1.10.0.537 AMXX Dev Team adminhelp.amxx running
[ 13] Menus Front-End 1.10.0.537 AMXX Dev Team menufront.amxx running
[ 14] Commands Menu 1.10.0.537 AMXX Dev Team cmdmenu.amxx running
[ 15] Players Menu 1.10.0.537 AMXX Dev Team plmenu.amxx running
[ 16] Teleport Menu 1.10.0.537 AMXX Dev Team telemenu.amxx running
[ 17] Maps Menu 1.10.0.537 AMXX Dev Team mapsmenu.amxx running
[ 18] Admin Chat 1.10.0.537 AMXX Dev Team adminchat.amxx running
[ 19] Anti Flood 1.10.0.537 AMXX Dev Team antiflood.amxx running
[ 20] Admin Votes 1.10.0.537 AMXX Dev Team adminvote.amxx running
[ 21] Pause Plugins 1.10.0.537 AMXX Dev Team pausecfg.amxx running
[ 22] Stats Configuration 1.10.0.537 AMXX Dev Team statscfg.amxx running
[ 23] AdminMenu 1.1 Nordic Warrior adminmenu.amxx running
[ 24] Advanced Lottery 0.6 Nordic Warrior advanced_lotter running
[ 25] [ReAPI] Advanced Team 0.1.0 fixe Vaqtincha AdvancedTeamCho running
[ 26] Advert Messages 1.23 neygomon adverts.amxx running
[ 27] AFK Protection 2.3.3 rapara13/Nordic afk.amxx running
[ 28] AimInfo 2.1 xPaw/Nordic Warr aim_info.amxx running
[ 29] Ball 1.2.1 xPaw/Nordic Warr ball.amxx running
[ 30] BhopHack Detector 0.1 Mistrick bhophack_detect running
[ 31] 49 44 49 20 4E 41 58 59 49 block_msg.amxx running
[ 32] Bypass Guard 24.05.2019 mx?! bypass_guard_ip running
[ 33] Advanced Client Checke 0.3.7e Mistrick cmdchecker.amxx running
[ 34] Connect Exec 1.1 AleX/Nordic Warr connect_exec.am running
[ 35] Chat Manager 4.4 OciXCrom crx_chatmanager running
[ 36] CM: Toggle Chat 4.1 OciXCrom crx_chatmanager running
[ 37] OciXCrom's Rank System 3.5 OciXCrom crx_ranksystem. running
[ 38] Knife Models 3.1 OciXCrom crx_knife_model running
[ 39] No Name Change 1.1-Re OciXCrom crx_nonamechang running
[ 40] ExpMenu for CRXRanks 0.3.1 Nordic Warrior crxranks_exp_ed running
[ 41] [ReAPI] Custom Models 1.6.1 neugomon custom_models.a running
[ 42] Demo Recorder 2.4.0 F@nt0M demo_recorder.a running
[ 43] Fix for sky 1.1 Nordic Warrior fix_maps.amxx running
[ 44] Gag System 1.1 TheRedShoko @ AM gag_system.amxx running
[ 45] GameName Changer 1.0 neugomon gamename.amxx running
[ 46] High Ping Kicker 1.0 OLO/shadow/Nordi high_ping_kicke running
[ 47] iFLY 1.0 arttty7 iFLY_no_save.am running
[ 48] iHOOK 1.0 arttty7 iHOOK.amxx debug
[ 49] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 50] Kill Distance 0.4 Nightscream/Nord kill_distance.a running
[ 51] Knife Duel Arena Edito 0.2 Nordic Warrior knife_duel_aren running
[ 52] Knife Duel Arena 1.32 bionext knife_duel_aren running
[ 53] Knife Duel Arena Edito 1.0 bionext knife_duel_aren paused
[ 54] Knife Duel Arena Block 0.2 bionext/Nordic W knife_duel_aren running
[ 55] Language Menu 1.0 F@nt0M langmenu.amxx running
[ 56] Light Menu 0.3 Nordic Warrior light_menu.amxx running
[ 57] Mind Games 1.1 fifayer/Nordic W MindGames.amxx running
[ 58] Money System Best t3rkecorejz MoneySystem.amx running
[ 59] Mute Menu 12.02.2019 w0w/Nordic Warri mute_menu.amxx running
[ 60] New Grab 1.1 Nordic Warrior/N new_grab_debug. running
[ 61] KillStreakAnnouncer 0.3 Nordic Warrior nkillstreak.amx running
[ 62] Knife Menu 1.3 Nordic Warrior nknifemenu.amxx running
[ 63] Knife shop 0.2.1 Nordic Warrior nknifeshop.amxx running
[ 64] Obscura Cam 0.8.2 Nani/NordicWarri ObscuraCam.amxx running
[ 65] Online Helper 2.1.3 Nordic Warrior online_helper.a running
[ 66] Paint Marker 1.7 w0w paint_marker.am running
[ 67] Paint Marker Addon 1.0 w0w paint_marker_ad running
[ 68] [ReAPI] Parachute 1.1 ReHLDS Team parachute.amxx running
[ 69] Pingwinowa bombka 0.1 diablix pingwin.amxx running
[ 70] Random skies 2.3 tuty/NordicWarri randomskies.amx running
[ 71] ReChecker Logging 1.0 custom rc_logging.amxx running
[ 72] Reset Score 1.1 Nordic Warrior reset_score.amx running
[ 73] Spectator Bots 2.1 SISA spectator_bots. running
[ 74] SteamID Limiter 0.4 Mistrick steamid_limiter running
[ 75] Money Transfer 1.2 x3/Nordic Warrio tm.amxx running
[ 76] Train Killer 1.2 Pastout!/Nordic trainkiller.amx running
[ 77] VipMenu 1.0 Nordic Warrior vipmenu.amxx running
[ 78] Yet Another Voteban 1.8 AndrewZ/voed yet_another_vot running
[ 79] unknown unknown unknown invis.amxx running
[ 80] Map Manager: Core 3.0.5 Mistrick map_manager_cor running
[ 81] Map Manager: Scheduler 0.1.3 Mistrick map_manager_sch running
[ 82] Map Manager: Rtv 0.1.0 Mistrick map_manager_rtv running
[ 83] Map Manager: Nominatio 0.1.2 Mistrick map_manager_nom debug
[ 84] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 85] Map Manager: Effects 0.0.8 edit Mistrick map_manager_eff running
[ 86] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 87] Map Manager: Advanced 0.0.5 Mistrick map_manager_adv running
87 plugins, 86 running
- Автор плагина
- Mistrick
- Версия плагина
- 0.1.2
- Исходный код
-
#include <amxmodx>
#include <map_manager>
#include <map_manager_blocklist>
#include <map_manager_adv_lists>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#define PLUGIN "Map Manager: Nomination"
#define VERSION "0.1.2"
#define AUTHOR "Mistrick"
#pragma semicolon 1
#define get_num(%0) get_pcvar_num(g_pCvars[%0])
#if !defined client_disconnected
#define client_disconnected client_disconnect
#endif
enum {
NOMINATION_FAIL,
NOMINATION_SUCCESS,
NOMINATION_REMOVED
};
enum {
TYPE_STANDART,
TYPE_FIXED
};
enum Cvars {
TYPE,
MAPS_IN_VOTE,
MAPS_PER_PLAYER,
DONT_CLOSE_MENU,
DENOMINATE_TIME,
RANDOM_SORT,
REMOVE_MAPS,
SHOW_LISTS
};
new g_pCvars[Cvars];
enum Forwards {
CAN_BE_NOMINATED
};
new g_hForwards[Forwards];
new Array:g_aNomList;
new Array:g_aMapsList;
new g_hCallbackDisabled;
new g_iNomMaps[33];
new g_iLastDenominate[33];
new bool:g_bIgnoreVote = false;
new g_sPrefix[48];
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
g_pCvars[DENOMINATE_TIME] = register_cvar("mapm_nom_denominate_time", "5"); // seconds
g_pCvars[RANDOM_SORT] = register_cvar("mapm_nom_random_sort", "0"); // 0 - disable, 1 - enable
g_pCvars[REMOVE_MAPS] = register_cvar("mapm_nom_remove_maps", "1"); // 0 - disable, 1 - enable
g_pCvars[SHOW_LISTS] = register_cvar("mapm_nom_show_lists", "0"); // 0 - disable, 1 - enable
g_hForwards[CAN_BE_NOMINATED] = CreateMultiForward("mapm_can_be_nominated", ET_CONTINUE, FP_CELL, FP_STRING);
register_clcmd("say", "clcmd_say");
register_clcmd("say_team", "clcmd_say");
register_clcmd("say maps", "clcmd_mapslist");
register_clcmd("say /maps", "clcmd_mapslist");
g_hCallbackDisabled = menu_makecallback("callback_disable_item");
}
public plugin_natives()
{
set_module_filter("module_filter_handler");
set_native_filter("native_filter_handler");
register_library("map_manager_nomination");
register_native("is_nomination_ignore_vote", "native_get_ignore");
register_native("map_nomination_set_ignore", "native_set_ignore");
}
public module_filter_handler(const library[], LibType:type)
{
if(equal(library, "map_manager_blocklist")) {
return PLUGIN_HANDLED;
}
if(equal(library, "map_manager_adv_lists")) {
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public native_filter_handler(const native_func[], index, trap)
{
if(equal(native_func, "mapm_get_blocked_count")) {
return PLUGIN_HANDLED;
}
if(equal(native_func, "mapm_advl_get_active_lists")) {
return PLUGIN_HANDLED;
}
if(equal(native_func, "mapm_advl_get_list_name")) {
return PLUGIN_HANDLED;
}
if(equal(native_func, "mapm_advl_get_list_array")) {
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public native_get_ignore(plugin, params)
{
return g_bIgnoreVote;
}
public native_set_ignore(plugin, params)
{
enum { arg_ignore = 1 };
g_bIgnoreVote = bool:get_param(arg_ignore);
}
public callback_disable_item()
{
return ITEM_DISABLED;
}
public mapm_maplist_loaded(Array:maplist)
{
g_aMapsList = maplist;
if(!g_aNomList) {
g_aNomList = ArrayCreate(NomStruct, 1);
}
if(get_num(REMOVE_MAPS)) {
remove_maps();
}
mapm_get_prefix(g_sPrefix, charsmax(g_sPrefix));
}
public client_disconnected(id)
{
if(g_iNomMaps[id]) {
clear_nominated_maps(id);
}
}
public clcmd_say(id)
{
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 map_index = mapm_get_map_index(text);
if(map_index != INVALID_MAP_INDEX) {
nominate_map(id, text);
} else if(strlen(text) >= 4) {
new Array:nominate_list = ArrayCreate(1, 1), array_size;
map_index = 0;
while( (map_index = find_similar_map(map_index, text)) != INVALID_MAP_INDEX ) {
ArrayPushCell(nominate_list, map_index);
array_size++;
map_index++;
}
if(array_size == 1) {
map_index = ArrayGetCell(nominate_list, 0);
new map_info[MapStruct]; ArrayGetArray(g_aMapsList, map_index, map_info);
nominate_map(id, map_info[Map]);
} else if(array_size > 1) {
show_nomlist(id, nominate_list, array_size);
}
ArrayDestroy(nominate_list);
}
return PLUGIN_CONTINUE;
}
nominate_map(id, map[])
{
if(mapm_get_blocked_count(map)) {
client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_NOM_NOT_AVAILABLE_MAP");
return NOMINATION_FAIL;
}
if(get_num(TYPE) == TYPE_FIXED && ArraySize(g_aNomList) >= get_num(MAPS_IN_VOTE)) {
client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_NOM_CANT_NOM2");
return NOMINATION_FAIL;
}
new nom_info[NomStruct], name[32];
get_user_name(id, name, charsmax(name));
new nom_index = map_nominated(map);
if(nom_index != INVALID_MAP_INDEX) {
ArrayGetArray(g_aNomList, nom_index, nom_info);
if(id != nom_info[NomPlayer]) {
client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_NOM_ALREADY_NOM");
return NOMINATION_FAIL;
}
new systime = get_systime();
if(g_iLastDenominate[id] + get_num(DENOMINATE_TIME) >= systime) {
client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_NOM_SPAM");
return NOMINATION_FAIL;
}
g_iLastDenominate[id] = systime;
g_iNomMaps[id]--;
ArrayDeleteItem(g_aNomList, nom_index);
client_print_color(0, id, "%s^3 %L", g_sPrefix, LANG_PLAYER, "MAPM_NOM_REMOVE_NOM", name, map);
return NOMINATION_REMOVED;
}
if(g_iNomMaps[id] >= get_num(MAPS_PER_PLAYER)) {
client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_NOM_CANT_NOM");
return NOMINATION_FAIL;
}
new ret;
ExecuteForward(g_hForwards[CAN_BE_NOMINATED], ret, id, map);
if(ret == NOMINATION_BLOCKED) {
return NOMINATION_FAIL;
}
copy(nom_info[NomMap], charsmax(nom_info[NomMap]), map);
nom_info[NomPlayer] = id;
ArrayPushArray(g_aNomList, nom_info);
g_iNomMaps[id]++;
client_print_color(0, id, "%s^3 %L", g_sPrefix, LANG_PLAYER, "MAPM_NOM_MAP", name, map);
return NOMINATION_SUCCESS;
}
show_nomlist(id, Array: array, size)
{
new text[64]; formatex(text, charsmax(text), "%L", LANG_PLAYER, "MAPM_MENU_FAST_NOM");
new menu = menu_create(text, "nomlist_handler");
new map_info[MapStruct], item_name[MAPNAME_LENGTH + 16], map_index, nom_index, block_count;
for(new i, str_num[6]; i < size; i++) {
map_index = ArrayGetCell(array, i);
ArrayGetArray(g_aMapsList, map_index, map_info);
num_to_str(map_index, str_num, charsmax(str_num));
nom_index = map_nominated(map_info[Map]);
block_count = mapm_get_blocked_count(map_info[Map]);
if(block_count) {
formatex(item_name, charsmax(item_name), "%s[\r%d\d]", map_info[Map], block_count);
menu_additem(menu, item_name, .callback = g_hCallbackDisabled);
} else if(nom_index != INVALID_MAP_INDEX) {
new nom_info[NomStruct]; ArrayGetArray(g_aNomList, nom_index, nom_info);
if(id == nom_info[NomPlayer]) {
formatex(item_name, charsmax(item_name), "%s[\y*\w]", map_info[Map]);
menu_additem(menu, item_name);
} else {
formatex(item_name, charsmax(item_name), "%s[\y*\d]", map_info[Map]);
menu_additem(menu, item_name, .callback = g_hCallbackDisabled);
}
} else {
menu_additem(menu, map_info[Map]);
}
}
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_BACK");
menu_setprop(menu, MPROP_BACKNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_NEXT");
menu_setprop(menu, MPROP_NEXTNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_EXIT");
menu_setprop(menu, MPROP_EXITNAME, text);
menu_display(id, menu);
}
public nomlist_handler(id, menu, item)
{
if(item == MENU_EXIT) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new item_info[8], item_name[MAPNAME_LENGTH + 16], access, callback;
menu_item_getinfo(menu, item, access, item_info, charsmax(item_info), item_name, charsmax(item_name), callback);
trim_bracket(item_name);
new nominated = nominate_map(id, item_name);
if(nominated == NOMINATION_REMOVED || get_num(DONT_CLOSE_MENU)) {
if(nominated == NOMINATION_SUCCESS) {
format(item_name, charsmax(item_name), "%s[\y*\w]", item_name);
menu_item_setname(menu, item, item_name);
} else if(nominated == NOMINATION_REMOVED) {
menu_item_setname(menu, item, item_name);
}
menu_display(id, menu);
} else {
menu_destroy(menu);
}
return PLUGIN_HANDLED;
}
public clcmd_mapslist(id)
{
if(get_num(SHOW_LISTS) && mapm_advl_get_active_lists() > 1) {
show_lists_menu(id);
} else {
show_nomination_menu(id, g_aMapsList);
}
}
show_lists_menu(id)
{
new text[64];
// TODO: add ML
new menu = menu_create("Maps lists:", "lists_handler");
new list[32], size = mapm_advl_get_active_lists();
for(new i; i < size; i++) {
mapm_advl_get_list_name(i, list, charsmax(list));
menu_additem(menu, list);
}
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_BACK");
menu_setprop(menu, MPROP_BACKNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_NEXT");
menu_setprop(menu, MPROP_NEXTNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_EXIT");
menu_setprop(menu, MPROP_EXITNAME, text);
menu_display(id, menu);
}
public lists_handler(id, menu, item)
{
if(item == MENU_EXIT) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
menu_destroy(menu);
if(item >= mapm_advl_get_active_lists()) {
clcmd_mapslist(id);
return PLUGIN_HANDLED;
}
new list_name[32];
mapm_advl_get_list_name(item, list_name, charsmax(list_name));
new Array:maplist = mapm_advl_get_list_array(item);
show_nomination_menu(id, maplist, list_name);
return PLUGIN_HANDLED;
}
show_nomination_menu(id, Array:maplist, custom_title[] = "")
{
new text[64];
if(!custom_title[0]) {
formatex(text, charsmax(text), "%L", LANG_PLAYER, "MAPM_MENU_MAP_LIST");
} else {
formatex(text, charsmax(text), "%s", custom_title);
}
new menu = menu_create(text, "mapslist_handler");
new map_info[MapStruct], item_name[MAPNAME_LENGTH + 16], block_count, size = ArraySize(maplist);
new random_sort = get_num(RANDOM_SORT), Array:array = ArrayCreate(1, 1);
for(new i = 0, index, nom_index; i < size; i++) {
if(random_sort) {
do {
index = random_num(0, size - 1);
} while(in_array(array, index));
ArrayPushCell(array, index);
} else {
index = i;
}
ArrayGetArray(maplist, index, map_info);
nom_index = map_nominated(map_info[Map]);
block_count = mapm_get_blocked_count(map_info[Map]);
if(block_count) {
formatex(item_name, charsmax(item_name), "%s[\r%d\d]", map_info[Map], block_count);
menu_additem(menu, item_name, .callback = g_hCallbackDisabled);
} else if(nom_index != INVALID_MAP_INDEX) {
new nom_info[NomStruct]; ArrayGetArray(g_aNomList, nom_index, nom_info);
if(id == nom_info[NomPlayer]) {
formatex(item_name, charsmax(item_name), "%s[\y*\w]", map_info[Map]);
menu_additem(menu, item_name);
} else {
formatex(item_name, charsmax(item_name), "%s[\y*\d]", map_info[Map]);
menu_additem(menu, item_name, .callback = g_hCallbackDisabled);
}
} else {
menu_additem(menu, map_info[Map]);
}
}
ArrayDestroy(array);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_BACK");
menu_setprop(menu, MPROP_BACKNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_NEXT");
menu_setprop(menu, MPROP_NEXTNAME, text);
formatex(text, charsmax(text), "%L", id, "MAPM_MENU_EXIT");
menu_setprop(menu, MPROP_EXITNAME, text);
menu_display(id, menu);
}
bool:in_array(Array:array, index)
{
for(new i, size = ArraySize(array); i < size; i++) {
if(ArrayGetCell(array, i) == index) {
return true;
}
}
return false;
}
public mapslist_handler(id, menu, item)
{
if(item == MENU_EXIT) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new item_info[8], item_name[MAPNAME_LENGTH + 16], access, callback;
menu_item_getinfo(menu, item, access, item_info, charsmax(item_info), item_name, charsmax(item_name), callback);
trim_bracket(item_name);
new nominated = nominate_map(id, item_name);
if(g_iNomMaps[id] < get_num(MAPS_PER_PLAYER) || get_num(DONT_CLOSE_MENU)) {
if(nominated == NOMINATION_SUCCESS) {
format(item_name, charsmax(item_name), "%s[\y*\w]", item_name);
menu_item_setname(menu, item, item_name);
} else if(nominated == NOMINATION_REMOVED) {
menu_item_setname(menu, item, item_name);
}
menu_display(id, menu, item / 7);
} else {
menu_destroy(menu);
}
return PLUGIN_HANDLED;
}
public mapm_prepare_votelist(type)
{
if(g_bIgnoreVote) {
return;
}
new nom_info[NomStruct];
new max_items = mapm_get_votelist_size();
for(new i = mapm_get_count_maps_in_vote(), index; i < max_items && ArraySize(g_aNomList); i++) {
index = random_num(0, ArraySize(g_aNomList) - 1);
ArrayGetArray(g_aNomList, index, nom_info);
ArrayDeleteItem(g_aNomList, index);
g_iNomMaps[nom_info[NomPlayer]]--;
if(mapm_push_map_to_votelist(nom_info[NomMap], PUSH_BY_NOMINATION) != PUSH_SUCCESS) {
i--;
}
}
}
map_nominated(map[])
{
new nom_info[NomStruct], size = ArraySize(g_aNomList);
for(new i; i < size; i++) {
ArrayGetArray(g_aNomList, i, nom_info);
if(equali(map, nom_info[NomMap])) {
return i;
}
}
return INVALID_MAP_INDEX;
}
clear_nominated_maps(id)
{
new nom_info[NomStruct];
for(new i = 0; i < ArraySize(g_aNomList); i++) {
ArrayGetArray(g_aNomList, i, nom_info);
if(id == nom_info[NomPlayer]) {
ArrayDeleteItem(g_aNomList, i--);
if(!--g_iNomMaps[id]) {
break;
}
}
}
}
find_similar_map(map_index, string[MAPNAME_LENGTH])
{
new map_info[MapStruct], end = ArraySize(g_aMapsList);
for(new i = map_index; i < end; i++) {
ArrayGetArray(g_aMapsList, i, map_info);
if(containi(map_info[Map], string) != -1) {
return i;
}
}
return INVALID_MAP_INDEX;
}
remove_maps()
{
new nom_info[NomStruct];
for(new i; i < ArraySize(g_aNomList); i++) {
ArrayGetArray(g_aNomList, i, nom_info);
if(mapm_get_map_index(nom_info[NomMap]) == INVALID_MAP_INDEX) {
g_iNomMaps[nom_info[NomPlayer]]--;
ArrayDeleteItem(g_aNomList, i--);
}
}
}
L 08/08/2019 - 05:59:24: Invalid array handle provided (0)
L 08/08/2019 - 05:59:24: [AMXX] Displaying debug trace (plugin "map_manager_nomination.amxx", version "0.1.2")
L 08/08/2019 - 05:59:24: [AMXX] Run time error 10: native error (native "ArraySize")
L 08/08/2019 - 05:59:24: [AMXX] [0] map_manager_nomination.sma::find_similar_map (line 498)
L 08/08/2019 - 05:59:24: [AMXX] [1] map_manager_nomination.sma::clcmd_say (line 166)
L 08/08/2019 - 05:59:24: [AMXX] Displaying debug trace (plugin "map_manager_nomination.amxx", version "0.1.2")
L 08/08/2019 - 05:59:24: [AMXX] Run time error 10: native error (native "ArraySize")
L 08/08/2019 - 05:59:24: [AMXX] [0] map_manager_nomination.sma::find_similar_map (line 498)
L 08/08/2019 - 05:59:24: [AMXX] [1] map_manager_nomination.sma::clcmd_say (line 166)
В этой теме было размещено решение! Перейти к решению.