Run time error 10: native error (native "menu_display")

Сообщения
1,340
Реакции
529
Помог
91 раз(а)
Ошибка
L 11/07/2019 - 07:19:29: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20191107.log")
L 11/07/2019 - 07:19:29: Player 3 is not in game.
L 11/07/2019 - 07:19:29: [AMXX] Displaying debug trace (plugin "map_manager_nomination.amxx", version "0.1.2")
L 11/07/2019 - 07:19:29: [AMXX] Run time error 10: native error (native "menu_display")
L 11/07/2019 - 07:19:29: [AMXX] [0] map_manager_nomination.sma::show_nomination_menu (line 414)
L 11/07/2019 - 07:19:29: [AMXX] [1] map_manager_nomination.sma::clcmd_mapslist (line 316)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5241
Билд
ReHLDS version: 3.7.0.692-dev
ReGamedll
ReGameDLL version: 5.11.0.420-dev+m
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] Reunion               RUN   -    reunion.so                  v0.1.0.133       ini  Start Never
[ 2] ReAuthCheck RUN - reauthcheck.so v0.1.6 ini Start Never
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.33 ini Start Never
[ 4] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY
[ 5] Rechecker RUN - rechecker.so v2.5 ini ANY
[ 6] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini ANY
[ 7] ReSemiclip RUN - resemiclip.so v2.3.9 ini ANY
[ 8] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[ 9] AMX Mod X RUN - amxmodx.so v1.9.0.5241 ini Start ANY
[10] WHBlocker RUN - whblocker.so v1.5.696 ini Chlvl ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.10.0.188-dev pl9 ANY Never
[13] Fun RUN - fun_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[16] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl9 ANY Never
[17] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[18] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
[19] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl9 ANY ANY
19 plugins, 19 running
Список плагинов
[  1] [ACP] General           v1.3         Hafner            acp_general.amx  running  
[ 2] ScreenMaker v1.1 neygomon screen_maker.am running
[ 3] FreshBans v1.4.0b kanagava fresh_bans_140_ running
[ 4] Warnings v0.0.3 beta Subb98 warnings_ban_co running
[ 5] Voice Control by CsSta v1.3[Engine neygomon voice_control.a running
[ 6] [ReAPI] AdminFreeLook v1.0 ReHLDS Team adminfreelook.a running
[ 7] [183] Ultimate Models v19.09.20 SKAJIbnEJIb ultimate_models running
[ 8] Weapon Restrict v2.1 s1lent & neugomo weaponrest.amxx running
[ 9] [ReAPI:AMXX] Buy Nades v0.0.3 steelzorrr amxx_buy_nades_ running
[ 10] [183] Ultimate Weapons v18.08.08BE SKAJIbnEJIb ultimate_weapon running
[ 11] [183] VIP RBS v18.12.17BE SKAJIbnEJIb vip_rbs.amxx running
[ 12] [ReAPI] Random Weapons v2.4.8 neugomon/h1k3 random_weapons_ running
[ 13] [183] Ultimate Flags v18.12.16 SKAJIbnEJIb ultimate_flags. running
[ 14] [183] WeaponMenu RBS v18.12.29BE SKAJIbnEJIb weaponmenu_rbs. running
[ 15] Team Custom Skin v0.0.1 Vaqtincha team_custom_ski running
[ 16] Team Custom Skin v0.0.1 Vaqtincha team_custom_ski running
[ 17] Team Custom Skin v0.0.1 Vaqtincha team_custom_ski running
[ 18] Team Custom Skin v0.0.1 Vaqtincha team_custom_ski running
[ 19] [183] Ultimate Gag v19.02.05BE SKAJIbnEJIb ultimate_gag.am running
[ 20] Admin Commands v1.9.0.5241 AMXX Dev Team admincmd.amxx running
[ 21] Menus Front-End v1.9.0.5241 AMXX Dev Team menufront.amxx running
[ 22] Commands Menu v1.9.0.5241 AMXX Dev Team cmdmenu.amxx running
[ 23] Players Menu v1.9.0.5241 AMXX Dev Team plmenu.amxx running
[ 24] Maps Menu v19.09.01 SKAJIbnEJIb & AM mapsmenu_rbs.am running
[ 25] Map Manager: Core v3.0.5 Mistrick map_manager_cor running
[ 26] Map Manager: Scheduler v0.1.3 Mistrick map_manager_sch running
[ 27] Map Manager: Advanced v0.0.5 Mistrick map_manager_adv running
[ 28] Map Manager: BlockList v0.0.3 Mistrick map_manager_blo running
[ 29] Map Manager: Effects v0.0.8 Mistrick map_manager_eff running
[ 30] Map Manager: Informer v0.0.5 Mistrick map_manager_inf running
[ 31] Map Manager: Nominatio v0.1.2 Mistrick map_manager_nom debug
[ 32] Map Manager: Online so v0.0.2 Mistrick map_manager_onl running
[ 33] Map Manager: Rtv v0.1.1 Mistrick map_manager_rtv running
[ 34] VoteBan v2.0 UFPS + F@nToM voteban_f.amxx running
[ 35] Pause Plugins v1.9.0.5241 AMXX Dev Team pausecfg.amxx running
[ 36] CsStats MySQL v15.07.15 SKAJIbnEJIb csstats_mysql.a running
[ 37] StatsX RBS v15.07.24 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 38] Stats Configuration v15.07.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 39] CS Misc. Stats v1.9.0.5241 AMXX Dev Team miscstats_MY_19 running
[ 40] [183] AfkKicker RBS v19.08.28 SKAJIbnEJIb afkkicker_rbs.a running
[ 41] Ping Control v1.31f neygomon(+wopox ping_control_wo running
[ 42] [ReAPI] Flasher Punish v0.0.2b Vaqtincha reapi_flasher_p running
[ 43] Advert Chat v2.0 UFPS + F@nToM adv_chat_f.amxx running
[ 44] Reset Score v2.0 UFPS + F@nToM rs_f.amxx running
[ 45] Chat Manager v1.1.1-11 Mistrick chatmanager.amx running
[ 46] Chat Manager: Addon v0.0.4-70 Mistrick chatmanager_add running
[ 47] Connect Info v10.10.2018 w0w connect_for_adm running
[ 48] ReAimDetector API v0.2.2 ReHLDS Team reaimdetector.a running
[ 49] [183] Damager RBS v19.08.30 SKAJIbnEJIb damager_rbs.amx running
[ 50] [183] Demo Recorder RB v18.02.08 SKAJIbnEJIb demorecorder_rb running
[ 51] Steаm Bonus v1.1 ill+F@nToM steam_bonus_my_ running
[ 52] Noob Bonus System v0.2 Subb98+juice+Vaq noob_bonus_syst running
[ 53] Parachute [ReAPI] v2.0 Leo_[BH] parachute_re.am running
[ 54] [183] Crux Ansata v17.10.30 Sanlerus crux_ansata.amx running
[ 55] GameName Changer v1.0 neugomon gamename_change running
[ 56] Best Player v2.2.9 DUKKHAZ0R | Jack best_player.amx running
[ 57] Winter Environment v1.0 Alka summer.amxx running
[ 58] client_buy forward v0.1.1 ConnorMcLeod client_buy1.amx running
[ 59] Health Grenade v1.2.8 Radius health_grenade. running
[ 60] Bomb pickup on use v1.0.1 voed use_bomb_pickup running
[ 61] SF Bets v0.1.5 serfreeman1337 sf_bets.amxx running
[ 62] Private Message v0.9 Denzer pm.amxx running
[ 63] [ReAPI] Block 'Fire in v0.0.1 sergrib reapi_block_FIT running
[ 64] Informer DHUD v2.0 UFPS.Team DHUD_fantom.amx running
[ 65] ColorChat v0.1.0 ConnorMcLeod colorchat.amxx running
[ 66] Advanced Experience Sy v0.4 serfreeman1337 aes_main.amxx running
[ 67] AES: Exp CSTRIKE v0.3 serfreeman1337 aes_exp_cstrike running
[ 68] AES: Informer v0.2 serfreeman1337 aes_informer.am running
[ 69] AES: Experience Editor v0.1 serfreeman1337 aes_exp_editor. running
[ 70] AES: Bonus System v0.2 serfreeman1337 aes_bonus_syste running
[ 71] AES: Bonus CSTRIKE v0.4 serfreeman1337 aes_bonus_cstri running
71 plugins, 71 running
Автор плагина
@Mistrick
Версия плагина
v0.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--);
}
}
}
В этой теме было размещено решение! Перейти к решению.

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
надо доавить проверку на невалидный айди
8 Ноя 2019
if(id > 32) и/или if(id != 0) и/или if(id < 1) - запрещать после выполнения условия или наоборот, но лучше выше всего кода запретить дальше проходит return PLUGIN_HANDLED;
8 Ноя 2019
игроку с таким то айди не может показатсья меню, типо того.. вроде так
 
Последнее редактирование:
Сообщения
25
Реакции
10
C++:
++if(is_user_connected(id))
    menu_display(id, menu);
 

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
C++:
if(is_user_alive(id)) show_nomination_menu(id, g_aMapsList);
8 Ноя 2019
хотя лучше как выше..
if(is_user_connected(id))
8 Ноя 2019
мертвым тоже нужно показывать?
8 Ноя 2019
if(is_user_alive(id))
-проверяет мертв ли игрок, и заодно проверяет подключен ли
 
Сообщения
1,340
Реакции
529
Помог
91 раз(а)
Brody, wellasgood, Прежде чем давать решение, возьмите плагин, добавьте свой код туда, пропустите через компилятор и если у вас все получится, напишите свое решение с обозначением строк/изменений.
 
Сообщения
25
Реакции
10
present, изменения описаны, строки у вас в ошибке пишут. А по поводу компиляции, что-то я не наблюдаю скинутых инклудов, которые используются в плагине.
Да и наше решение рабочее, у вас меню пытается открыть отключенному игроку. Как выше описали, если вам надо показывать только живым, то Натив is_user_alive(id)
 
  • Нравится
Реакции: Ayk

Rey

Сообщения
197
Реакции
190
Помог
5 раз(а)
Я с таким сталкивалась в вип кастоме, достаточно добавить чек на конект и все)
Выше кто то уже предлагал этот вариант)
 
Последнее редактирование:
Сообщения
584
Реакции
1,006
Помог
18 раз(а)
Больше выглядит как косяк амхх. Почему невалидный игрок пришел в хук register_clcmd?
Как фикс-костыль можно чм поставить выше мм плагинов.
 

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Mistrick, редкая ошибка, я тоже пользуюсь, не замечал такого..
8 Ноя 2019
может это у него из другого плагина что там так выходит, т.е виноват другой плагин какой то возможно
 
Сообщения
1,304
Реакции
2,303
Помог
57 раз(а)
C++:
++if(is_user_connected(id))
    menu_display(id, menu);
Меню создали, но не показали. Смысл был создавать? Раз плеер не валидный, то и отрубать надо в начале функции, а не в конце.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу