Logs Errors In Plugin !!!

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
5
Реакции
0
Ошибка
L 08/27/2022 - 17:39:21: Start of error session.
L 08/27/2022 - 17:39:21: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20220827.log")
L 08/27/2022 - 17:39:21: Invalid menu id 0(1)
L 08/27/2022 - 17:39:21: [AMXX] Displaying debug trace (plugin "gunmenu.amxx", version "1.0")
L 08/27/2022 - 17:39:21: [AMXX] Run time error 10: native error (native "menu_item_getinfo")
L 08/27/2022 - 17:39:21: [AMXX] [0] gunmenu.sma::OpenMenu_sub (line 134)
L 08/27/2022 - 17:42:04: Invalid menu id 0(1)
L 08/27/2022 - 17:42:04: [AMXX] Displaying debug trace (plugin "gunmenu.amxx", version "1.0")
L 08/27/2022 - 17:42:05: [AMXX] Run time error 10: native error (native "menu_item_getinfo")
L 08/27/2022 - 17:42:05: [AMXX] [0] gunmenu.sma::OpenMenu_sub (line 134)
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5294 (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: Dec 3 2021 22:52:28
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a8
Build ID: 5294:363871a8
Core mode:
Билд
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 19:52:54 Aug 3 2020 (8684)
ReGamedll
Not Using [Only HLDS]
Версия Metamod
Metamod v1.21p37  2013/05/30 (5:13)
by Will Day
http://www.metamod.org/
Patch: Metamod-P (mm-p) v37
by Jussi Kivilinna
http://metamod-p.sourceforge.net/
compiled: May 30 2013, 11:41:14 EET (optimized)
Список метамодулей
description      stat pend  file              vers      src   load  unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5 ini Start ANY
[ 2] MySQL RUN - mysql_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 3] SQLite RUN - sqlite_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 4] Fun RUN - fun_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dl v1.9.0.5 pl1 ANY ANY
[ 7] CStrike RUN - cstrike_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 8] CSX RUN - csx_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl1 ANY ANY
[10] ReAPI RUN - reapi_amxx.dll v5.21.0. pl1 ANY Never
10 plugins,
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5294 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5294 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0.5294 AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.9.0.5294 AMXX Dev Team statsx.amxx running
[ 22] Info Top 1.4 ->UrOS<- roundinfo.amxx running
[ 23] Gun Menu 1.0 begin gunmenu.amxx debug
Автор плагина
Begin
Версия плагина
1.0
Исходный код
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "Gun Menu"
#define VERSION "1.0"
#define AUTHOR "begin"
new g_round,g_c4
new g_pMenuCancel,g_menu_active,g_menuAvailableRound,g_awp_active,g_ak47_active,g_m4a1_active;
new g_CvarHe,g_CvarFlash,g_CvarSmoke
#define PREFIX_CHAT "^4[AMXX]"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
g_menu_active = register_cvar("menu_active", "1")
g_CvarHe = register_cvar( "amx_cvar_vip_he_cancel", "1" );
g_CvarFlash = register_cvar( "amx_cvar_vip_flash_cancel", "1" );
g_CvarSmoke = register_cvar( "amx_cvar_vip_smoke_cancel", "0" );
g_m4a1_active = register_cvar("amx_m4a1_menu_cancel", "0")
g_ak47_active = register_cvar("amx_ak47_menu_cancel", "1");
g_awp_active = register_cvar("amx_awp_menu_cancel", "1");
g_pMenuCancel = register_cvar("amx_vip_menu_cancel", "15");
g_menuAvailableRound = register_cvar("amx_vip_available_round", "3")

register_logevent("logevent_round_start", 2, "1=Round_Start");
register_event("TextMsg", "Event_Round_Restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in");
}
public Event_Round_Restart()
{
g_round = 0;
}
public logevent_round_start()
{
g_round++;
new players[32], pnum;
get_players(players, pnum, "ac");
new availableRound = get_pcvar_num(g_menuAvailableRound)
for(new i = 0, iplayer; i < pnum; i++)
{
iplayer = players[i]
if (!is_user_alive(iplayer)) continue;

if (get_pcvar_num(g_CvarHe))
{
give_item(iplayer, "weapon_hegrenade");
}
if (get_pcvar_num(g_CvarFlash))
{
give_item(iplayer, "weapon_flashbang");
give_item(iplayer, "weapon_flashbang");
}
if (get_pcvar_num(g_CvarSmoke))
{
give_item(iplayer, "weapon_smokegrenade")
}
give_item(iplayer, "item_assaultsuit");
give_item(iplayer, "item_thighpack");

if (g_round<=availableRound)
{
client_print_color(iplayer, print_team_default, "%s^3 Menu will be available in^4 %i^3 Round",PREFIX_CHAT,(availableRound+1)-g_round);
}
else
{
if (get_pcvar_num(g_menu_active)&&g_round>=availableRound)
{
OpenMenu(iplayer)
}
else
{
client_print_color(iplayer, print_team_default, "%s^3 Menu Not Actived^1 [^4Contact Admins^1]",PREFIX_CHAT);
}
}
}

return PLUGIN_HANDLED;
}
public OpenMenu(id)
{
new iMenu = menu_create("Free VIP Guns", "OpenMenu_sub");

menu_additem(iMenu, "Get M4A1+Deagle","0",_,menu_makecallback("M4A1_Menu_Cancel"));
menu_additem(iMenu, "Get AK47+Deagle","1",_,menu_makecallback("AK47_Menu_Cancel"));
menu_additem(iMenu, "Get AWP+Deagle","2",_,menu_makecallback("AWP_Menu_Cancel"));
menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL);
new iSec = get_pcvar_num(g_pMenuCancel)
menu_display(id, iMenu, 0,iSec);
client_print_color(id, print_team_default, "%s^3 Please Choose Your^4 VIP Gun^3, Menu Will Closed in^4 %i^3 Seconds",PREFIX_CHAT, iSec);
set_task(float(iSec), "Destroy_Menu", id)
}
public Destroy_Menu ()
{
new menuid,menu;
for(new Num; Num < 32; Num++)
{
if(!is_user_connected(Num))
continue;
if (player_menu_info(Num,menu, menuid))
{
if (menuid != -1)
{
menu_destroy(menuid);
show_menu(Num, 0, "^n", 1);
}
}
}
}
public AWP_Menu_Cancel(id, Menu, item)
{
return get_pcvar_num( g_awp_active ) ? ITEM_ENABLED : ITEM_DISABLED;
}
public AK47_Menu_Cancel(id, Menu, item)
{
return get_pcvar_num( g_ak47_active ) ? ITEM_ENABLED : ITEM_DISABLED;
}
public M4A1_Menu_Cancel(id, Menu, item)
{
return get_pcvar_num( g_m4a1_active ) ? ITEM_ENABLED : ITEM_DISABLED;
}


public OpenMenu_sub(id, menu, item)
{
if(item == MENU_EXIT || !is_user_alive(id))
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new iData[6]
new iAccess
new iCallback
new iName[64]

menu_item_getinfo(menu, item, iAccess, iData, 5, iName, 63, iCallback)

switch(str_to_num(iData))
{
case 0:
{
select_m4a1(id);
}
case 1:
{
select_ak47(id);
}
case 2:
{
select_awp(id)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public select_ak47(id)
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
give_item(id, "item_assaultsuit");
if (get_pcvar_num(g_CvarHe))
{
give_item(id, "weapon_hegrenade");
}
if (get_pcvar_num(g_CvarFlash))
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
}
if (get_pcvar_num(g_CvarSmoke))
{
give_item(id, "weapon_smokegrenade")
}
give_item(id, "weapon_ak47");
cs_set_user_bpammo(id, CSW_AK47, 90);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);

if(user_has_weapon(id, CSW_C4))
g_c4 = true;

if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "item_thighpack");
}
else if(cs_get_user_team(id) == CS_TEAM_T)
{
if(g_c4)
{
give_item(id, "weapon_c4");
cs_set_user_plant(id, 1, 1);
}
}
client_print_color(id,print_team_default,"%s^3 You Got Free^4 AK47^3 and^4 Deagle",PREFIX_CHAT);
}
public select_m4a1(id)
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
give_item(id, "item_assaultsuit");
if (get_pcvar_num(g_CvarHe))
{
give_item(id, "weapon_hegrenade");
}
if (get_pcvar_num(g_CvarFlash))
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
}
if (get_pcvar_num(g_CvarSmoke))
{
give_item(id, "weapon_smokegrenade")
}
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 90);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);

if(user_has_weapon(id, CSW_C4))
g_c4 = true;
if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "item_thighpack");
}
else if(cs_get_user_team(id) == CS_TEAM_T)
{
if(g_c4)
{
give_item(id, "weapon_c4");
cs_set_user_plant(id, 1, 1);
}
}
client_print_color(id,print_team_default,"%s^3 You Got Free^4 M4A1^3 and^4 Deagle",PREFIX_CHAT);
}
public select_awp(id)
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
give_item(id, "item_assaultsuit");
if (get_pcvar_num(g_CvarHe))
{
give_item(id, "weapon_hegrenade");
}
if (get_pcvar_num(g_CvarFlash))
{
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
}
if (get_pcvar_num(g_CvarSmoke))
{
give_item(id, "weapon_smokegrenade")
}
give_item(id, "weapon_awp");
cs_set_user_bpammo(id, CSW_AWP, 30);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);

if(user_has_weapon(id, CSW_C4))
g_c4 = true;
if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "item_thighpack");
}
else if(cs_get_user_team(id) == CS_TEAM_T)
{
if(g_c4)
{
give_item(id, "weapon_c4");
cs_set_user_plant(id, 1, 1);
}
}
client_print_color(id,print_team_default,"%s^3 You Got Free^4 AWP^3 and^4 Deagle",PREFIX_CHAT);
}
Hi All
I'm a noob in scripting and i made this plugin with the help of others and also,have so much unnecessary codes as i am learning to make plugin but here its give me error of logs file and its completely compiled but give error in game [Please fix it and also anyone want to fix unnecessary code then please also fix that ]

Main: To Fix Logs Error
Optional: If needed to fix unnecessary code

Thank You !!!
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
101
Реакции
-11
Помог
2 раз(а)
Обьясняю по русскому, вы пытались применить натив menu_destroy() к несуществуещему menuid, тоесть menuid у вас равен 0. Сделайте вывод
 
Статус
В этой теме нельзя размещать новые ответы.

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

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