Unhandled dynamic native error

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
552
Реакции
49
Предупреждения
2
Помог
4 раз(а)
Ошибка
L 01/23/2023 - 14:17:22: Unhandled dynamic native error
L 01/23/2023 - 14:17:22: [AMXX] Displaying debug trace (plugin "xman2030_ze_mod.amxx", version "")
L 01/23/2023 - 14:17:22: [AMXX] Run time error 10: native error (native "zp_next_level_exp")
L 01/23/2023 - 14:17:22: [AMXX] [0] xman2030_ze_mod.sma::ShowHUD (line 8567)
L 01/23/2023 - 14:17:23: [AMXX] Run time error 4 (plugin "xman2030_level.amxx") - debug not enabled!
L 01/23/2023 - 14:17:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

L 01/23/2023 - 14:16:38: Unhandled dynamic native error
L 01/23/2023 - 14:16:38: [AMXX] Displaying debug trace (plugin "xman2030_ze_mod.amxx", version "")
L 01/23/2023 - 14:16:38: [AMXX] Run time error 10: native error (native "zp_next_level_exp")
L 01/23/2023 - 14:16:38: [AMXX] [0] xman2030_ze_mod.sma::ShowHUD (line 8561)

с debug:
L 01/23/2023 - 14:18:51: Unhandled dynamic native error
L 01/23/2023 - 14:18:51: [AMXX] Displaying debug trace (plugin "xman2030_ze_mod.amxx", version "")
L 01/23/2023 - 14:18:51: [AMXX] Run time error 10: native error (native "zp_next_level_exp")
L 01/23/2023 - 14:18:51: [AMXX] [0] xman2030_ze_mod.sma::ShowHUD (line 8567)
L 01/23/2023 - 14:18:52: [AMXX] Displaying debug trace (plugin "xman2030_level.amxx", version "6.0")
L 01/23/2023 - 14:18:52: [AMXX] Run time error 4: index out of bounds
L 01/23/2023 - 14:18:52: [AMXX] [0] xman2030_level.sma::native_zp_next_level_exp (line 460)
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5249 (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:32:02
Built from: https://github.com/alliedmodders/amxmodx/commit/6cecb34e
Build ID: 5249:6cecb34e
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.10.0.759-dev
Build date: 15:34:13 Jun 22 2021 (2628)
Build from: https://github.com/dreamstalker/rehlds/commit/ad6f6ad
ReGamedll
ReGameDLL version: 5.21.0.556-dev
Build date: 08:44:42 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 15:47:38 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] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] <voicetranscoder.dll> badf load voicetranscoder.dll v - ini - -
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5249 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.5 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm.dll v1.5.696 ini Chlvl ANY
[ 8] <resemiclip_m.dll> badf load resemiclip_m.dll v - ini - -
[ 9] Ultimate Unprecacher RUN - ultimate_unprecacher_mm.dll v0.3 Alpha ini ANY ANY
[10] CStrike RUN - cstrike_amxx.dll v1.9.0.5249 pl5 ANY ANY
[11] CSX RUN - csx_amxx.dll v1.9.0.5249 pl5 ANY ANY
[12] Fun RUN - fun_amxx.dll v1.9.0.5249 pl5 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5249 pl5 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5249 pl5 ANY ANY
[15] GeoIP RUN - geoip_amxx.dll v1.9.0.5249 pl5 ANY ANY
[16] MySQL RUN - mysql_amxx.dll v1.9.0.5249 pl5 ANY ANY
[17] SQLite RUN - sqlite_amxx.dll v1.9.0.5249 pl5 ANY ANY
[18] Engine RUN - engine_amxx.dll v1.9.0.5249 pl5 ANY ANY
[19] ReAPI RUN - reapi_amxx.dll v5.19.0.211-dev pl5 ANY Never
[20] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5 ANY Never
[21] Orpheu RUN - orpheu_amxx.dll v2.6.3 pl5 ANY ANY
21 plugins, 19 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Map Manager 2.5.60 Mistrick mapmanager.amxx running
[ 2] mute 1.0 Aziz xman2030_mute.a running
[ 3] Admin Base 1.9.0.5249 AMXX Dev Team admin.amxx running
[ 4] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
[ 5] Admin Help 1.9.0.5249 AMXX Dev Team adminhelp.amxx running
[ 6] Slots Reservation 1.9.0.5249 AMXX Dev Team adminslots.amxx running
[ 7] Multi-Lingual System 1.9.0.5249 AMXX Dev Team multilingual.am running
[ 8] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
[ 9] Players Menu 1.9.0.5249 AMXX Dev Team plmenu.amxx running
[ 10] Teleport Menu 1.9.0.5249 AMXX Dev Team telemenu.amxx running
[ 11] Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
[ 12] Plugin Menu 1.9.0.5249 AMXX Dev Team pluginmenu.amxx running
[ 13] Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx running
[ 14] Anti Flood 1.9.0.5249 AMXX Dev Team antiflood.amxx running
[ 15] Admin Votes 1.9.0.5249 AMXX Dev Team adminvote.amxx running
[ 16] Pause Plugins 1.9.0.5249 AMXX Dev Team pausecfg.amxx running
[ 17] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 18] Ultimate Gore 1.6 JTP10181 amx_gore_ultima running
[ 19] TimeLeft 1.9.0.5249 AMXX Dev Team timeleft.amxx running
[ 20] Advanced Weapon Tracer 1.3.0 ConnorMcLeod advanced_weapon running
[ 21] NextMap 1.9.0.5249 AMXX Dev Team nextmap.amxx stopped
[ 22] POD-Bot Menu 1.3 g4s|figurE.09 amxx_podbotmenu running
[ 23] Game Namer 1.1 NeuroToxin gamenamechanger running
[ 24] Precache Management 1.0.0 ConnorMcLeod precache_manage stopped
[ 25] Advert Messages 1.2 neygomon adverts.amxx running
[ 26] Fix Remove Entity When zm zm zp_entityfix.am paused
[ 27] ScreenMaker 1.1 neygomon screen_maker.am running
[ 28] fb_forwards 0.1.8 Mazdan & Neugomo fb_forwards.amx running
[ 29] FreshBans 1.4.0b kanagava fresh_bans_1.4. running
[ 30] Menus Front-End 1.5 neugomon menufront_end.a running
[ 31] AMXX Gag 1.4.9 xPaw & Exolent amx_gag.amxx running
[ 32] motd 1.1 L@NPOC@N motd.amxx running
[ 33] unknown unknown unknown warnings.amxx bad load
[ 34] Anti Reklama 1.1 MarcaD anti_reklama.am running
[ 35] unknown unknown unknown health_nade.amx bad load
[ 36] SpecList 1.2a FatalisDK speclist_rus.am running
[ 37] DemoRecoder 1.2 neygomon demorecoder.amx running
[ 38] AFK Manager 1.2 Xramer afk_manager.amx paused
[ 39] Chat Logger 2.1a Jim chat_logger.amx running
[ 40] Zombie Escape xman2030 xman2030_ze_mod debug
[ 41] [ZP]Level System 6.0 Dambas xman2030_level. running
[ 42] Camera View 0.0.1 ConnorMcLeod talrasha_camera debug
[ 43] [ZE] ZClass: Hunter 1.0 KOBRA / t3rkecor xman2030_speed. running
[ 44] [ZP] Class : Frank 1.0 tumoxa xman2030_pc.amx running
[ 45] DJB Zombie Class Banch 1.0 Csoldjb xman2030_witch. running
[ 46] [CSO Like] ZClass: Yak 0.2 | 30.0 inf xman2030_sasha. running
[ 47] [ZP Class] Flying Zomb 0.1 ONYX xman2030_flying running
[ 48] ZP Class Energy Ball(T 2.1 Jim/tERoR edit/O xman2030_tesla. running
[ 49] [CSO] Class String Fin 2.0 BLACK_ROSE zp_class_finger running
[ 50] Undertaker 1.0 DSHGFHDS zp_undertaker.a debug
[ 51] NST Zombie Class Heal 1.0 NST NST_ZbClass_Hea running
[ 52] [ZP] Drowned Zombie 1.2 tuty/CHyC zp_drowned_zomb running
[ 53] Houndeye Zombie 0.4 Morte zp_zclass_hound running
[ 54] unknown unknown unknown azp_zclass_sire running
[ 55] [CSO:Heavy Zombie] 1.1 REDEMAX cso_heavy.amxx running
[ 56] CSO Lusty Rose 1.0.1 ALBTeam zp_class_LustyR running
[ 57] [ZP] Class: x-Voodoo 2019 | 1.0 xUnicorn (t3rkec zp_zclass_voodo running
[ 58] [CSO:Hunter Zombie] 1.2 HoRRoR/tERoR edi zp_china.amxx running
[ 59] xman2030_zombieclass_b CS-FADE.RU CS-FADE.RU xman2030_zombie running
[ 60] ZM VIP 1.7.2 aaarnas xman2030_vip.am running
[ 61] [FS] Chat 1.1 Inf xman2030_chat.a running
[ 62] Heli Button Info 1.0 Shanks' xman2030_showes running
[ 63] [ZP] EASY SAVE AMMO 1.2 CS-FADE.RU xman2030_ammo_a running
[ 64] [ZP] Addon: Win Models 0.1 CS-FADE.RU xman2030_ze_amo debug
[ 65] [ZP Addon] Knives 0.1 ONYX xman2030_knifes running
[ 66] [ZP] Admin Lvl Menu 1.0 Dambas xman2030_level_ running
[ 67] ZE HUD Final CS-FADE.RU xman2030_ze_hud running
[ 68] NadeModes 11.2 Nomexous & OT xman2030_nademo running
[ 69] [ZP] ZP++ Ice Cube 1.0 DareDevil (Gyiov xman2030_ice_cu running
[ 70] Weapon Model + Sound R 1.2 GHW_Chronic GHW_Weapon_Repl running
[ 71] xman2030_damager CS-FADE.RU CS-FADE.RU xman2030_damage running
[ 72] ZP: Zombie Health 1.0 Yakess yakess_health.a debug
[ 73] Countdown 1.7.3 T a l R a s h a gameplay_countd running
[ 74] Zp info Big 0.1 TalRasha zp_info_big.amx running
[ 75] [ZP] Addon: Ammo Box 1.1 | 2019 xUnicorn zp_addon_ammobo running
[ 76] ammo donate/dhud 1.5 user/zobie-dead zp_ammo_donate. running
[ 77] Team Locker 1.5 Bmann_420 teamlocker.amxx running
[ 78] xman2030_human_revolut CS-FADE.RU CS-FADE.RU xman2030_human_ running
[ 79] xman2030_evolution_bon CS-FADE.RU CS-FADE.RU xman2030_evolut running
[ 80] xman2030_cons CS-FADE.RU CS-FADE.RU xman2030_cons.a running
[ 81] [ZP] Addon: Evolution 0.0.7 https://vk.com/i xman2030_evolut running
[ 82] xman2030_aura CS-FADE.RU CS-FADE.RU xman2030_aura.a running
[ 83] xman2030_blood CS-FADE.RU CS-FADE.RU xman2030_blood. running
[ 84] ZP Reloading! Shout 0.0.1 xPaw,wbyokomo reloading_weapo running
[ 85] [ZP] Addon: Weather 0.1 | 30.0 inf / xman2030 xman2030_weathe running
[ 86] unknown unknown unknown xman2030_leader running
[ 87] [ZP] Shoot Light 0.1 | 11.0 inf xman2030_shot_l running
[ 88] [ZP] Round ended effec 1.0 *GEORGE* xman2030_ended_ running
[ 89] [ZP] Round Draw Blast 1.0 MeRcyLeZZ xman2030_round_ running
[ 90] [ZP]Present 1.0 CrAsH xman2030_presen running
[ 91] Menu_Priv 1.0 CS-FADE.RU xman2030_menu_p running
[ 92] [ZP] VIP menu 1.2 CS-FADE.RU xman2030_vip_me running
[ 93] [ZP] VIP menu 1.2 CS-FADE.RU xman2030_deluxe running
[ 94] [ZP] VIP menu 1.2 CS-FADE.RU xman2030_creato debug
[ 95] ammo paki 4.0 Bagamut xman2030_ammo_m running
[ 96] unknown unknown unknown xman2030_lk.amx running
[ 97] [ZP] Extra Item: Jump 1.0 Opo4uMapy xman2030_jumpbo running
[ 98] [ZP] Extra Item Speed 1.2 MeRcyLeZZ zp_extra_speed_ running
[ 99] unknown unknown unknown xman2030_buy_hp running
[100] Janus 1 1.0 m4m3ts xman2030_janus1 running
[101] [CSO LIKE] Extra: Gull 1.0 Lakerovich xman2030_bloodr running
[102] [Zombie Plague] Weapon 0.7 PlaneShfit1231 / zp_extra_rpg7.a running
[103] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 xman2030_m3.amx running
[104] [ZP] Weapon: M32 1.0 PbI)I(Uu' / Batc xman2030_m32.am running
[105] [ZP] Extra: CSO ClayMo 1.0 TemplateAuthor:K xman2030_Claymo running
[106] [ZP] Air Strike 1.0 Dorus xman2030_air_st running
[107] [CSO LIKE] LaserMG 1.1 Lakerovich cso_weapon_lase running
[108] Janus-11 1.0 m4m3ts zp_extra_janus1 running
[109] [ZP] Extra: HK416 1.0 Crock / =) (Popr yt_extra_janus1 running
[110] Rail Cannon 1.0 m4m3ts zp_extra_railca running
[111] [ZP] Weapon: Shining H 1.0 xUnicorn (t3rkec zp_weapon_magic running
[112] ZP Extraitem: FNP-45 1.0 Base: Batcon; Re zp_extraitems_f running
[113] [ZP] Weapon: JANUS-7 1.0 xUnicorn (t3rkec zp_weapon_janus running
[114] Extraitems: Water Pist 1.0 Base: Batcon & x zp_extraitems_w running
[115] [ZP] Weapon: Crossbow 1.0 xUnicorn (t3rkec zp_weapon_cross running
[116] [ZMO] Extra-Item: Skul 1.0 Mr.Kot3 zmo_weapon_skul running
[117] [ZP] Weapon: DInfinity 1.0 -- zp_weapon_duali running
[118] [ZP] Extra: m134ex 1.0 LARS-DAY[BR]EAKE zp_weapon_m134e running
[119] [Z] Weapon: M2 0.6 beta batcon weapon_m2.amxx running
[120] Extraitems: Oz Lion Pi 1.0 Base: Batcon & x zp_extraitems_o running
[121] [ZP] Extra item: Aeoli 1.0 m4m3ts zp_extra_aeolis running
[122] [ZP] Weapon: Salamande 1.0 xUnicorn (t3rkec zp_weapon_flame running
[123] [ZP] Extra: Squeak Gre 1.0.6-wwm Arkshine zp_extra_squeak running
[124] [ZE] Addon: XMAS 2040 0.1 | 30.0 Reega! inf2030_ze_lead running
[125] [ZM] Choose Weapon 1.6.1 t3rkecorejz | Un xman2030_menu_w running
[126] HUINYA HUINYA HUINYA xman2030_def_we running
[127] [ZP] Extra: Anaconda 1.0 Crock / =) (Popr xman2030_anacon running
[128] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 xman2030_Vulcan running
[129] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 xman2030_Sapien running
[130] [ZP] Extra: M1887 1.0 Crock / =) (Popr xman2030_m1887. running
[131] [ZMO]Weapon: Cyclone 1.0 Base: Batcon; Re xman2030_cyclon running
[132] [ZP] Weapon: Shining H 1.0 xUnicorn (t3rkec xman2030_magicm running
[133] [CSO] Ethereal 0.0.1 Shurik07 xman2030_ethere running
( 33) Load fails: Invalid Plugin (plugin "warnings.amxx")
( 35) Load fails: Module/Library "curl" required for plugin. Check modules.ini.
133 plugins, 127 running
Автор плагина
xman2030
Версия плагина
1337
Исходный код
/*
===================================================================
[ZP]Level System 6.0 FINAL
Автор : Dambas

Обновление :
*Сохранение по MySQL
*Меню выдачи опыта

Главный разработчик - https://vk.com/limonka__s
*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>
#include <zp_level_system>

#define is_user_valid_connected(%1) (1 <= %1 <= g_maxplayers && g_isconnected[%1])
#define is_user_valid_alive(%1) (1 <= %1 <= g_maxplayers && g_isalive[%1])
#define is_user_valid(%1) (1 <= %1 <= g_maxplayers)

#define MYSQL_SAVE // MySQL сохранение
//#define NVAULT_SAVE // Nvault сохранение

//#define HUD // Показывает худ опыта
#define LUP // Screen-fade, когда обновляется уровень.

#if defined MYSQL_SAVE
#include <sqlx>
#endif
#if defined NVAULT_SAVE
#include <nvault>
#endif

//Опыт для каждого уровня 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
new const Level_Exp[51] = {1, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000}
new g_level[51], g_exp[51], g_next_exp[50], string[21], exp[3][33]

new const level_up[] = "xman2030/task_complete.wav"

new g_maxplayers, d_exp, Float:g_PlayerDamage[33]
new pcvar_damage[10]

#if defined NVAULT_SAVE
new g_vault
#endif

#if defined MYSQL_SAVE

#define SQL_HOST "" // host name
#define SQL_USER ""
#define SQL_PASSWORD ""
#define SQL_DATABASE ""
#define SQL_TABLENAME "zp_level_system"

new Handle:MYSQL_Tuple
new Handle:MYSQL_Connect
new g_szQuery[512];

new bool: UserLoaded[33];
new UserSteamID[33][34];
#endif

public plugin_init()
{
register_plugin("[ZP]Level System", "6.0", "Dambas")

RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage")

register_logevent("RoundStart", 2, "1=Round_Start")

pcvar_damage[0] = register_cvar("zp_dmg_for_xp", "500") // Сколько урона надо нанести для того что бы получить 1 опыт
pcvar_damage[1] = register_cvar("zp_give_xp_for_dmg", "1") // Сколько опыта получит id за нанесенный урон
pcvar_damage[2] = register_cvar("zp_give_for_kill_nem", "10") // Сколько получит id за убийство немезиды
pcvar_damage[3] = register_cvar("zp_give_for_kill_sur", "10") // Сколько получит id за убийство выжевшего
pcvar_damage[4] = register_cvar("zp_give_for_kill_last", "10") // Сколько получит id за убийство последнего человека
pcvar_damage[5] = register_cvar("zp_give_for_kill", "5") // Сколько получит id-человек, за убийство зомби

pcvar_damage[6] = register_cvar("zp_give_zombie", "1") // Сколько получит зомби за убийство человека
pcvar_damage[7] = register_cvar("zp_give_nemesis", "1") // Сколько получит Немезида за убийство человека
pcvar_damage[8] = register_cvar("zp_give_surv", "1") // Сколько получит Выживший за убийство зомби
pcvar_damage[9] = register_cvar("zp_give_lasthum", "10") // Сколько получит Последний человек за убийство зомби

g_maxplayers = get_maxplayers()

#if defined NVAULT_SAVE
g_vault = nvault_open("xman2030_lvl")
#endif
}

public plugin_precache()
{
precache_sound(level_up)
}

public plugin_natives()
{
register_native("zp_level", "native_level", 1)
register_native("zp_exp", "native_exp", 1)
register_native("zp_next_level_exp", "native_zp_next_level_exp", 1)

register_native("zp_get_user_exp", "native_zp_get_user_exp", 1)
register_native("zp_set_user_exp", "native_zp_set_user_exp", 1)
}

public plugin_cfg()
{
new cfgdir[32]
get_configsdir(cfgdir, charsmax(cfgdir))
server_cmd("exec %s/xman2030_lvl.cfg", cfgdir)

#if defined MYSQL_SAVE
SQL_LoadDebug();
#endif
}

public client_connect(id)
{
if (is_user_bot(id))
return

#if defined NVAULT_SAVE
LoadData(id)
#endif
}

public client_putinserver(id)
{
#if defined MYSQL_SAVE
LoadData(id)
#endif
set_task(3.0, "func_change_exp", id)
}

public client_disconnect(id)
{
#if defined NVAULT_SAVE
SaveData(id)
#endif

#if defined MYSQL_SAVE
if(!UserLoaded[id])
return;

formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `lvl` = '%d', `exp` = '%d' WHERE `%s`.`SteamID` = '%s';", SQL_TABLENAME, g_level[id], g_exp[id], SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)
#endif

remove_task(id)
}

public plugin_end()
{
#if defined NVAULT_SAVE
nvault_close(g_vault)
#endif

#if defined MYSQL_SAVE
if(MYSQL_Tuple)
SQL_FreeHandle(MYSQL_Tuple)

if(MYSQL_Connect)
SQL_FreeHandle(MYSQL_Connect)
#endif
}

#if defined MYSQL_SAVE
public SQL_LoadDebug()
{
new szError[512]
new iErrorCode

MYSQL_Tuple = SQL_MakeDbTuple(SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE)
MYSQL_Connect = SQL_Connect(MYSQL_Tuple, iErrorCode, szError, charsmax(szError))

if(MYSQL_Connect == Empty_Handle)
set_fail_state(szError)

if(!SQL_TableExists(MYSQL_Connect, SQL_TABLENAME))
{
new Handle:hQueries
new szQuery[512]

formatex( szQuery, charsmax(szQuery), "CREATE TABLE IF NOT EXISTS `%s` (SteamID VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_general_ci NOT NULL, lvl INT NOT NULL, exp INT NOT NULL, PRIMARY KEY (SteamID))", SQL_TABLENAME)
hQueries = SQL_PrepareQuery(MYSQL_Connect, szQuery)

if( !SQL_Execute(hQueries))
{
SQL_QueryError(hQueries, szError, charsmax(szError))
set_fail_state(szError)
}
SQL_FreeHandle(hQueries)
}
SQL_QueryAndIgnore(MYSQL_Connect, "SET NAMES utf8")
}

public SQL_Query( iState, Handle: hQuery, szError[], iErrorCode, iParams[], iParamsSize)
{
switch(iState)
{
case TQUERY_CONNECT_FAILED: log_amx("Load - Could not connect to SQL database. [%d] %s", iErrorCode, szError)
case TQUERY_QUERY_FAILED: log_amx("Load Query failed. [%d] %s", iErrorCode, szError)
}

new id = iParams[0]
UserLoaded[id] = true

if(SQL_NumResults(hQuery) < 1)
{
if(equal(UserSteamID[id], "ID_PENDING"))
return PLUGIN_HANDLED
formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO `%s` (`SteamID`, `lvl`, `exp`) VALUES ('%s', '%d', '%d');", SQL_TABLENAME, UserSteamID[id], g_level[id], g_exp[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)

return PLUGIN_HANDLED;
}
else
{
g_level[id] = SQL_ReadResult(hQuery, 1)
g_exp[id] = SQL_ReadResult(hQuery, 2)
}

return PLUGIN_HANDLED;
}

public LoadData(id)
{

if(!is_user_connected(id))
return;

new iParams[1]
iParams[0] = id

get_user_authid(id, UserSteamID[id], charsmax(UserSteamID[]))

formatex(g_szQuery, charsmax(g_szQuery), "SELECT * FROM `%s` WHERE (`%s`.`SteamID` = '%s')", SQL_TABLENAME, SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Query", g_szQuery, iParams, sizeof iParams)
}

public SQL_Thread(iState, Handle: hQuery, szError[], iErrorCode, iParams[], iParamsSize)
{
if(iState == 0)
return;

log_amx("SQL Error: %d (%s)", iErrorCode, szError)
}
#endif



#if defined NVAULT_SAVE
public SaveData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s",AuthID)
format(vaultdata,255,"%i#%i#%i#",g_exp[id],g_level[id],g_next_exp[id])
nvault_set(g_vault,vaultkey,vaultdata)

return PLUGIN_CONTINUE;
}
public LoadData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s",AuthID)
format(vaultdata,255,"%i#%i#%i#",g_exp[id],g_level[id],g_next_exp[id])
nvault_get(g_vault,vaultkey,vaultdata,255)

replace_all(vaultdata, 255, "#", " ")

new playerxp[32], playerlevel[32], playernextexp[32]

parse(vaultdata, playerxp, 31, playerlevel, 31)

g_exp[id] = str_to_num(playerxp)
g_level[id] = str_to_num(playerlevel)
g_next_exp[id] = str_to_num(playernextexp)

return PLUGIN_CONTINUE;
}
#endif


public func_change_exp (id)
{
d_exp = zp_get_user_exp(id)

exp[0][id] = d_exp
exp[1][id] = d_exp
exp[2][id] = d_exp

#if defined HUD
set_task(1.0,"change_exp",id,_,_,"b")
#endif
}

public change_exp(id)
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR && is_user_connected(id))
return PLUGIN_HANDLED

exp[1][id] = zp_get_user_exp(id)

if(exp[1][id] != exp[2][id])
{
if(exp[1][id] > exp[2][id])
{
d_exp = exp[1][id] - exp[2][id]
format(string,charsmax(string),"[+%d Опыт]", d_exp)
}

exp[2][id] = exp[1][id]

set_hudmessage(255, 15, 247, 0.57, 0.57, 0, 6.0, 3.0,_,_,4)
show_hudmessage(id, "%s", string)
}
return PLUGIN_HANDLED;
}

public fwTakeDamage(id, inflictor, attacker, Float:damage)
{
if(!is_user_connected(attacker))
return;

if(zp_get_user_zombie(attacker) || zp_get_user_survivor(attacker) || zp_get_user_nemesis(attacker))
return;

if(g_level[attacker] > Level_Exp[id])
return;

g_PlayerDamage[attacker] += damage

if(g_PlayerDamage[attacker] >= get_pcvar_float(pcvar_damage[0]))
{
g_exp[attacker] += get_pcvar_num(pcvar_damage[1])
change_exp(id)
g_PlayerDamage[attacker] -= get_pcvar_float(pcvar_damage[0])
}
check_level(attacker)
}

public fw_PlayerKilled(id, killer)
{
menu_cancel(id)
if(!is_user_alive(killer))
return;

if(g_level[killer] > Level_Exp[id])
return;

if(zp_get_user_nemesis(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[2])

else if(zp_get_user_survivor(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[3])

else if(zp_get_user_last_human(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[4])

else if(zp_get_user_zombie(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[6])

else if(zp_get_user_nemesis(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[7])

else if(zp_get_user_survivor(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[8])

else if(zp_get_user_last_human(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[9])

else
g_exp[killer] += get_pcvar_num(pcvar_damage[5])

check_level(killer)
}

public check_level(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;

new MAX_LVL = sizeof Level_Exp - 1;

if (g_exp[id] > Level_Exp[MAX_LVL] - 1 )
return PLUGIN_HANDLED;


if( g_exp[id] >= Level_Exp[ g_level[id]])
{
if ( g_level[id] < MAX_LVL )
{
g_level[id]++
emit_sound(id, CHAN_STREAM, level_up, 1.0, ATTN_NORM, 0, PITCH_NORM)
#if defined LUP
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, id)
write_short(1 << 11)
write_short(1 << 11)
write_short(0x0001)
write_byte(255)
write_byte(255)
write_byte(0)
write_byte(110)
message_end()
#endif
ChatColor(id, "!g[ZE] !yТы достиг !g%d !yуровня.", g_level[id])
g_exp[id] = 0
}
}

return PLUGIN_HANDLED;
}

public RoundStart()
{
new players[32], num, i
get_players (players, num)

for( i=1; i < num; i++ )
{
exp[0][players[i]] = zp_get_user_exp(players[i])
}

#if defined MYSQL_SAVE
for(new id = 1; id <= 32; id++)
{
if(!is_user_connected(id))
continue;

if(!UserLoaded[id])
return;

formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `lvl` = '%d', `exp` = '%d' WHERE `%s`.`SteamID` = '%s';", SQL_TABLENAME, g_level[id], g_exp[id], SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)
}
#endif
}

public native_level(id)
{
return g_level[id];
}

public native_exp(id)
{
return g_exp[id];
}

public native_zp_next_level_exp(id)
{
return Level_Exp[g_level[id]];
}

public native_zp_get_user_exp(id)
{
if (!is_user_valid(id))
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
return -1;
}

return g_exp[id];
}

public native_zp_set_user_exp(id, amount)
{
if (!is_user_valid(id))
{
return false;
}

g_exp[id] = amount
check_level(id)
return true;
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!r", "^3")
replace_all(msg, 190, "!b", "^0")

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}

stock bool: SQL_TableExists(Handle: hDataBase, const szTable[])
{
new Handle: hQuery = SQL_PrepareQuery(hDataBase, "SELECT * FROM information_schema.tables WHERE table_name = '%s' LIMIT 1;", szTable)
new szError[512]

if(!SQL_Execute(hQuery))
{
SQL_QueryError(hQuery, szError, charsmax(szError))
set_fail_state(szError)
}
else if( !SQL_NumResults(hQuery))
{
SQL_FreeHandle(hQuery)
return false;
}
SQL_FreeHandle(hQuery)
return true;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
Всем привет. Возникла ошибка, с модом zombie plague, когда у меня уровень сохраняется по базе данных mysql, то появляется эта ошибка, и уровень не работает. Кто-то знает что делать? Исходный код главного мода прикрепляю как файл.
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
893
Реакции
149
Помог
25 раз(а)
Лвл система выдает ошибки в консоль?
 
Сообщения
552
Реакции
49
Предупреждения
2
Помог
4 раз(а)
ImmortalAmxx, да
L 01/23/2023 - 14:18:52: [AMXX] Displaying debug trace (plugin "xman2030_level.amxx", version "6.0")
L 01/23/2023 - 14:18:52: [AMXX] Run time error 4: index out of bounds
L 01/23/2023 - 14:18:52: [AMXX] [0] xman2030_level.sma::native_zp_next_level_exp (line 460)
 
Сообщения
552
Реакции
49
Предупреждения
2
Помог
4 раз(а)
ImmortalAmxx, так у меня и из 6.0 работало отлично
 
Сообщения
893
Реакции
149
Помог
25 раз(а)
Скорее всего автор сборки что-то допиливал, советую просто взять оригинальную версию этой лвл системы, либо взять другую, и переделать нативы под себя.
23 Янв 2023
Artemich, ты случайно себе уровень не пытался выдать?
 
Сообщения
893
Реакции
149
Помог
25 раз(а)
Artemich, ты выдал 90 уровень, хотя максимум 51.
Удали свою запись и не выдавай уровень больше указанного в коде. И проблема исчезнет.
 
Сообщения
552
Реакции
49
Предупреждения
2
Помог
4 раз(а)
ImmortalAmxx, спс большое, пробелма ушла)) тупанул немного
 
Сообщения
893
Реакции
149
Помог
25 раз(а)
Artemich, не за что, если дойдут руки, сделаю лвл систему под зп 4.3 через удобные настройки.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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