rz_menu_join_human (invalid index)

Сообщения
458
Реакции
263
Помог
9 раз(а)
Ошибка
L 01/06/2022 - 01:33:49: Invalid index 5 (count: 0)
L 01/06/2022 - 01:33:49: [AMXX] Displaying debug trace (plugin "menus/rz_menu_join_human.amxx", version "2.0.4")
L 01/06/2022 - 01:33:49: [AMXX] Run time error 10: native error (native "ArrayGetCell")
L 01/06/2022 - 01:33:49: [AMXX] [0] rz_menu_join_human.sma::@HandleMenu_ChooseTeam_Pre (line 157)
ОС
Linux
Amx Mod X
AMX Mod X 1.10.0.5435 (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: Aug 7 2021 08:32:30
Built from: https://github.com/alliedmodders/amxmodx/commit/36d5aa9
Build ID: 5435:36d5aa9
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev
Build date: 03:13:55 Oct 25 2021 (2753)
Build from: https://github.com/dreamstalker/rehlds/commit/471158b
ReGamedll
ReGameDLL version: 5.21.0.540-dev
Build date: 17:33:16 Oct 25 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/b9cccc6
Версия 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.92d ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.7 ini ANY
[ 4] Revoice RUN - revoice_plus_mm.so v1.0.1 ini ANY Never
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini ANY
[ 7] AMX Mod X RUN - amxmodx.so v1.10.0.5435 ini Start ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5435 pl7 ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.10.0.5435 pl7 ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.10.0.5435 pl7 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5435 pl7 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.21.0.248-dev pl7 ANY Never
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5435 pl7 ANY ANY
[14] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
14 plugins, 14 running
Список плагинов
Currently loaded plugins:
id name version author url file status
[ 1] 0 GameCMS_API 5.5.3 vzhorzh78 unknown gamecms_api debug
[ 2] 1 FreshBans v1.4.5b kanagava fresh_bans_ running
[ 3] 2 [ReZP] API: Main v2.0.4 fl0wer api/rz_api_ running
[ 4] 3 [ReZP] API: Game Modes v2.0.4 fl0wer api/rz_api_ running
[ 5] 4 [ReZP] API: Weapons v2.0.4 fl0wer api/rz_api_ running
[ 6] 5 [ReZP] API: Items v2.0.4 fl0wer api/rz_api_ running
[ 7] 6 [ReZP] API: Player v2.0.4 fl0wer api/rz_api_ running
[ 8] 7 [ReZP] API: Player Cla v2.0.4 fl0wer api/rz_api_ running
[ 9] 8 [ReZP] API: Player Sub v2.0.4 fl0wer api/rz_api_ running
[ 10] 9 [ReZP] API: Player Pro v2.0.4 fl0wer api/rz_api_ running
[ 11] 10 [ReZP] API: Player Mod v2.0.4 fl0wer api/rz_api_ running
[ 12] 11 [ReZP] API: Player Sou v2.0.4 fl0wer api/rz_api_ running
[ 13] 12 [ReZP] API: Night Visi v2.0.4 fl0wer api/rz_api_ running
[ 14] 13 [ReZP] Main v2.0.4 fl0wer rz_main.amx running
[ 15] 14 [ReZP] Game Rules v2.0.4 fl0wer rz_gamerule running
[ 16] 15 [ReZP] Game Modes v2.0.4 fl0wer rz_gamemode running
[ 17] 16 [ReZP] Weapons v2.0.4 fl0wer rz_weapons. running
[ 18] 17 [ReZP] Player v2.0.4 fl0wer rz_player.a running
[ 19] 18 [ReZP] Class: Zombie v2.0.4 fl0wer player/rz_c running
[ 20] 19 [ReZP] Class: Human v2.0.4 fl0wer player/rz_c running
[ 21] 20 [ReZP] Class: Nemesis v2.0.4 fl0wer player/rz_c running
[ 22] 21 [ReZP] Class: Survivor v2.0.4 fl0wer player/rz_c running
[ 23] 22 [ReZP] Class: Assassin v2.0.4 fl0wer player/rz_c running
[ 24] 23 [ReZP] Class: Sniper v2.0.4 fl0wer player/rz_c running
[ 25] 24 [ReZP] Zombie Sub-clas v2.0.4 fl0wer player/rz_s running
[ 26] 25 [ReZP] Zombie Sub-clas v2.0.4 fl0wer player/rz_s running
[ 27] 26 [ReZP] Zombie Sub-clas v2.0.4 fl0wer player/rz_s running
[ 28] 27 [ReZP] Human Sub-class v2.0.4 fl0wer player/rz_s running
[ 29] 28 [ReZP] Human Sub-class v2.0.4 fl0wer player/rz_s running
[ 30] 29 [ReZP] Game Mode: Mult v2.0.4 fl0wer gamemodes/r running
[ 31] 30 [ReZP] Game Mode: Swar v2.0.4 fl0wer gamemodes/r running
[ 32] 31 [ReZP] Game Mode: Neme v2.0.4 fl0wer gamemodes/r running
[ 33] 32 [ReZP] Game Mode: Surv v2.0.4 fl0wer gamemodes/r running
[ 34] 33 [ReZP] Game Mode: Plag v2.0.4 fl0wer gamemodes/r running
[ 35] 34 [ReZP] Game Mode: Assa v2.0.4 fl0wer gamemodes/r running
[ 36] 35 [ReZP] Game Mode: Snip v2.0.4 fl0wer gamemodes/r running
[ 37] 36 [ReZP] Game Mode: Arma v2.0.4 fl0wer gamemodes/r running
[ 38] 37 [ReZP] Game Mode: Assa v2.0.4 fl0wer gamemodes/r running
[ 39] 38 [ReZP] Grenade: Fire v2.0.4 fl0wer weapons/rz_ running
[ 40] 39 [ReZP] Grenade: Frost v2.0.4 fl0wer weapons/rz_ running
[ 41] 40 [ReZP] Grenade: Flare v2.0.4 fl0wer weapons/rz_ running
[ 42] 41 [ReZP] Weapon: Sniper v2.0.4 fl0wer weapons/rz_ running
[ 43] 42 [ReZP] Item: Madness v2.0.4 fl0wer items/rz_it running
[ 44] 43 [ReZP] Item: Antidote v2.0.4 fl0wer items/rz_it running
[ 45] 44 [ReZP] Item: Grenades v2.0.4 fl0wer items/rz_it running
[ 46] 45 [ReZP] Item: Weapons v2.0.4 fl0wer items/rz_it running
[ 47] 46 [ReZP] Item: Nightvisi v2.0.4 fl0wer items/rz_it running
[ 48] 47 [ReZP] Item: Armor v2.0.4 fl0wer items/rz_it running
[ 49] 48 [ReZP] Menu: Game v2.0.4 fl0wer menus/rz_me running
[ 50] 49 [ReZP] Menu: Weapons v2.0.4 fl0wer menus/rz_me running
[ 51] 50 [ReZP] Menu: Extra Ite v2.0.4 fl0wer menus/rz_me running
[ 52] 51 [ReZP] Menu: Choose Zo v2.0.4 fl0wer menus/rz_me running
[ 53] 52 [ReZP] Menu: Admin v2.0.4 fl0wer menus/rz_me running
[ 54] 53 [ReZP] Admin Menu: Res v2.0.4 fl0wer menus/rz_me running
[ 55] 54 [ReZP] Admin Menu: Gam v2.0.4 fl0wer menus/rz_me running
[ 56] 55 [ReZP] Admin Menu: Cha v2.0.4 fl0wer menus/rz_me running
[ 57] 56 [ReZP] Menu: Instant C v2.0.4 fl0wer menus/rz_me debug
[ 58] 57 [ReZP] Join Menu: Huma v2.0.4 fl0wer menus/rz_me debug
[ 59] 58 [ReZP] Addon: Round No v2.0.4 fl0wer addons/rz_a running
[ 60] 59 [ReZP] Addon: Awards v2.0.4 fl0wer addons/rz_a running
[ 61] 60 [ReZP] Addon: Player I v2.0.4 fl0wer addons/rz_a running
[ 62] 61 [ReZP] Addon: Status B v2.0.4 fl0wer addons/rz_a running
[ 63] 62 [ReZP] Addon: Buy Ammo v2.0.4 fl0wer addons/rz_a running
[ 64] 63 [ReZP] Addon: Humam Fl v2.0.4 fl0wer addons/rz_a running
[ 65] 64 [ReZP] Addon: Long Jum v2.0.4 fl0wer addons/rz_a running
[ 66] 65 [ReZP] Addon: Bleeding v2.0.4 fl0wer addons/rz_a running
[ 67] 66 [ReZP] Config: Game Mo v2.0.4 fl0wer configs/rz_ running
[ 68] 67 [ReZP] Config: Weapons v2.0.4 fl0wer configs/rz_ running
[ 69] 68 [ReZP] Config: Items v2.0.4 fl0wer configs/rz_ running
[ 70] 69 [ReZP] Config: Player v2.0.4 fl0wer configs/rz_ running
[ 71] 70 ReAimDetector API v0.2.2 ReHLDS Team guard/reaim running
[ 72] 71 ReChecker Logging v1.0 custom guard/rc_lo running
72 plugins, 72 running
Автор плагина
fl0wer
Версия плагина
v2.0.4
Исходный код
#pragma semicolon 1

#include <amxmodx>
#include <reapi>
#include <rezp>

const SUBCLASS_MAX_PAGE_ITEMS = 7;

new g_iMenuPage[MAX_PLAYERS + 1];
new Array:g_aMenuItems[MAX_PLAYERS + 1];

new g_iClass_Human;

new mp_auto_join_team;

public plugin_precache()
{
register_plugin("[ReZP] Join Menu: Human Subclasses", REZP_VERSION_STR, "fl0wer");

RZ_CHECK_CLASS_EXISTS(g_iClass_Human, "class_human");

for (new i = 1; i <= MaxClients; i++)
g_aMenuItems[i] = ArrayCreate(1, 0);
}

public plugin_init()
{
register_clcmd("jointeam", "@Command_JoinCmd");
register_clcmd("joinclass", "@Command_JoinCmd");
register_clcmd("chooseteam", "@Command_ChooseTeam");

RegisterHookChain(RG_ShowVGUIMenu, "@ShowVGUIMenu_Pre", false);
RegisterHookChain(RG_ShowVGUIMenu, "@ShowVGUIMenu_Post", true);
RegisterHookChain(RG_HandleMenu_ChooseTeam, "@HandleMenu_ChooseTeam_Pre", false);

bind_pcvar_num(get_cvar_pointer("mp_auto_join_team"), mp_auto_join_team);
}

public client_putinserver(id)
{
g_iMenuPage[id] = 0;
}

@Command_JoinCmd(id)
{
return PLUGIN_HANDLED;
}

@Command_ChooseTeam(id)
{
if (is_nullent(id))
return PLUGIN_CONTINUE;

if (get_member(id, m_iJoiningState) == JOINED)
return PLUGIN_CONTINUE;

SubclassSelectMenu_Show(id);
return PLUGIN_HANDLED;
}

@ShowVGUIMenu_Pre(id, VGUIMenu:menuType, bitsSlots, oldMenu[])
{
if (mp_auto_join_team)
return HC_CONTINUE;

switch (menuType)
{
case VGUI_Menu_Team:
{
set_member(id, m_bForceShowMenu, true);
SubclassSelectMenu_Show(id, g_iMenuPage[id]);
return HC_SUPERCEDE;
}
case VGUI_Menu_Class_T, VGUI_Menu_Class_CT:
{
set_member(id, m_bForceShowMenu, true);
}
}

return HC_CONTINUE;
}

@ShowVGUIMenu_Post(id, VGUIMenu:menuType, bitsSlots, oldMenu[])
{
if (mp_auto_join_team)
return;

if (menuType == VGUI_Menu_Class_T || menuType == VGUI_Menu_Class_CT)
{
RequestFrame("@RequestFrame_ChooseApp", id);
}
}

@RequestFrame_ChooseApp(id)
{
if (!is_user_connected(id))
return;

set_member(id, m_iMenu, Menu_ChooseAppearance);
engclient_cmd(id, "menuselect", "0");
}

@HandleMenu_ChooseTeam_Pre(id, MenuChooseTeam:slot)
{
if (mp_auto_join_team)
return HC_CONTINUE;

if (is_user_bot(id))
{
ArrayClear(g_aMenuItems[id]);

new subclassStart = rz_subclass_start();
new subclassSize = rz_subclass_size();

for (new i = subclassStart; i < subclassStart + subclassSize; i++)
{
if (rz_subclass_get(i, RZ_SUBCLASS_CLASS) != g_iClass_Human)
continue;

if (rz_subclass_player_get_status(id, i) >= RZ_BREAK)
continue;

ArrayPushCell(g_aMenuItems[id], i);
}
}

new itemsNum = ArraySize(g_aMenuItems[id]);
new key = any:slot - 1;

if (key == 9)
{
new subclass = ArrayGetCell(g_aMenuItems[id], random_num(0, itemsNum - 1));

rz_player_set(id, RZ_PLAYER_SUBCLASS_CHOSEN, subclass, g_iClass_Human);
}
else
{
if (itemsNum > 9)
{
switch (key)
{
case 7:
{
g_iMenuPage[id]++;
SetHookChainReturn(ATYPE_INTEGER, false);
return HC_SUPERCEDE;
}
case 8:
{
g_iMenuPage[id]--;
SetHookChainReturn(ATYPE_INTEGER, false);
return HC_SUPERCEDE;
}
}
}

new subclass = ArrayGetCell(g_aMenuItems[id], g_iMenuPage[id] * SUBCLASS_MAX_PAGE_ITEMS + key);

rz_player_set(id, RZ_PLAYER_SUBCLASS_CHOSEN, subclass, g_iClass_Human);
}

SetHookChainArg(2, ATYPE_INTEGER, MenuChoose_CT);
return HC_CONTINUE;
}

SubclassSelectMenu_Show(id, page = 0)
{
ArrayClear(g_aMenuItems[id]);

new subclassStart = rz_subclass_start();
new subclassSize = rz_subclass_size();

for (new i = subclassStart; i < subclassStart + subclassSize; i++)
{
if (rz_subclass_get(i, RZ_SUBCLASS_CLASS) != g_iClass_Human)
continue;

if (rz_subclass_player_get_status(id, i) >= RZ_BREAK)
continue;

ArrayPushCell(g_aMenuItems[id], i);
}

new itemsNum = ArraySize(g_aMenuItems[id]);

if (itemsNum <= 1)
return false;

new bool:singlePage = bool:(itemsNum < 10);
new itemPerPage = singlePage ? 9 : SUBCLASS_MAX_PAGE_ITEMS;
new i = min(page * itemPerPage, itemsNum);
new start = i - (i % itemPerPage);
new end = min(start + itemPerPage, itemsNum);

g_iMenuPage[id] = start / itemPerPage;

new keys;
new len;
new index;
new item;
new text[MAX_MENU_LENGTH];
new name[32];
new desc[64];

SetGlobalTransTarget(id);

rz_class_get(g_iClass_Human, RZ_CLASS_NAME, name, charsmax(name));

if (singlePage)
add_formatex("\y%l^n^n", "RZ_SELECT_SUBCLASS", name);
else
add_formatex("\y%l \r%d/%d^n^n", "RZ_SELECT_SUBCLASS", name, g_iMenuPage[id] + 1, ((itemsNum - 1) / itemPerPage) + 1);

for (i = start; i < end; i++)
{
index = ArrayGetCell(g_aMenuItems[id], i);

rz_subclass_get(index, RZ_SUBCLASS_NAME, name, charsmax(name));
rz_subclass_get(index, RZ_SUBCLASS_DESC, desc, charsmax(desc));

if (rz_subclass_player_get_status(id, index) == RZ_CONTINUE)
{
add_formatex("\r%d. \w%l \d%l^n", item + 1, name, desc);
keys |= (1<<item);
}
else
add_formatex("\d%d. %l %l^n", item + 1, name, desc);

item++;
}

if (!singlePage)
{
for (i = item; i < SUBCLASS_MAX_PAGE_ITEMS; i++)
add_formatex("^n");

if (end < itemsNum)
{
add_formatex("^n\r8. \w%l", "RZ_NEXT");
keys |= MENU_KEY_8;
}
else
add_formatex("^n\d8. %l", "RZ_NEXT");

if (g_iMenuPage[id])
{
add_formatex("^n\r9. \w%l", "RZ_BACK");
keys |= MENU_KEY_9;
}
else
add_formatex("^n\d9. %l", "RZ_BACK");
}

add_formatex("^n\r0. \w%l^n", "RZ_AUTOSELECT");
keys |= MENU_KEY_0;

show_menu(id, keys, text);
set_member(id, m_iMenu, Menu_ChooseTeam);
return true;
}
Ошибка выкидуется даже если на сервере нет никого - после каждой смены мапы
 

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

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