Ошибка в плагине knifedm

Сообщения
321
Реакции
73
Помог
11 раз(а)
Ошибка
L 10/23/2019 - 19:22:52: [HAMSANDWICH] Entity has null private data (7)
L 10/23/2019 - 19:22:52: [AMXX] Displaying debug trace (plugin "knifedm.amxx", version "1.1")
L 10/23/2019 - 19:22:52: [AMXX] Run time error 10: native error (native "ExecuteHamB")
L 10/23/2019 - 19:22:52: [AMXX] [0] knifedm.sma::spawn_user (line 78)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5249 (http://www.amxmodx.org)
Билд
ReHLDS version: 3.7.0.692-dev-mpatch
ReGamedll
ReGameDLL version: 5.11.0.420-dev+m
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.so         v0.1.75          ini  Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5249 ini Start ANY
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 6] ReParachute RUN - parachute_amxx_i386.so v1.1 Beta pl4 ANY ANY
[ 7] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[11] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[12] Fun RUN - fun_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[14] MySQL RUN - mysql_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[15] VTC AMXX API RUN - VtcApi_amxx_i386.so v2017 RC pl4 ANY ANY
[16] ReAPI RUN - reapi_amxx_i386.so v5.10.0.188-dev pl4 ANY Never
[17] whois RUN - whois_amxx_i386.so v0.2.270 pl4 ANY ANY
[18] CURL AMXX RUN - curl_amxx_i386.so v1.1.0 pl4 ANY ANY
18 plugins, 18 running
Список плагинов
[  1] FreshBans               1.3.8b      kanagava          fresh_bans_138_  running  
[ 2] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 3] Admin Loader 2.6.2 neygomon admin_loader.am running
[ 4] Anticheat 3.1.6 ctr52 anticheat.amxx running
[ 5] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 6] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 7] Knife DeathMatch 1.1 Lucky knifedm.amxx debug
[ 8] SpacePK.ru DM BlockRad 1.0 You? blockradio.amxx running
[ 9] Custom Models 1.3.2 neugomon custom_models.a running
[ 10] Block Change Name 1.0 DJ_WEST block_change_na running
[ 11] MG Grab 1.0 Nickron mg_grab.amxx running
[ 12] HATS 0.2 SgtBane Hats02.amxx running
[ 13] Admin Commands Log 16.10.2018 w0w admin_commands_ running
[ 14] Lite Hook 1.0 OverGame lite_hook.amxx running
[ 15] Players Menu 1.3.2 neugomon players_menu.am debug
[ 16] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 17] Sky change helper 0.1 AMXX.Shop sky_change_help running
[ 18] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 19] Advert Messages 1.22 neygomon adverts.amxx running
[ 20] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 21] Chat Checker 0.1a Subb98 chat_checker.am running
[ 22] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 23] Train Killer 1.0 Pastout! trainkiller.amx running
[ 24] Chat Logger 2.1a Jim chat_logger.amx running
[ 25] Spray Block 1.0 maFFyoZZyk Spray_Block.amx running
[ 26] Reset Score ReFreshed 0.0.1 wopox1337@Dev-CS ResetScore_ReFr running
[ 27] Advanced Client Checke 0.3.6 Mistrick cmdchecker.amxx debug
[ 28] Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx running
[ 29] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
[ 30] Menus Front-End 1.5 untest neugomon menufront_end.a running
[ 31] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
[ 32] Advanced Rechecker 0.4 F@nt0M rechecker.amxx running
[ 33] Teleport Menu 1.9.0.5249 AMXX Dev Team telemenu.amxx running
[ 34] Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
[ 35] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 36] CS Stats Logging 1.9.0.5249 AMXX Dev Team stats_logging.a running
[ 37] CS Misc. Stats 1.9.0.5249 AMXX Dev Team miscstats.amxx debug
[ 38] plugin_trail 1.3.1 Bahrmanou plugin_trail.am running
[ 39] Knife Duels 2.0.5 Adrenaline's Wra KnifeDuels.amxx running
[ 40] BUYADM 1 LAW motd_v1.amxx running
[ 41] BUYADM 1 LAW motdrules.amxx running
[ 42] Camera Changer 1.3 Bl0ck Camera_Changer. running
[ 43] Unlimited ChooseTeam ( 1.0 ConnorMcLeod & p unlimited_choos running
[ 44] Bypass Guard 24.05.2019 mx?! bypass_guard_ip running
[ 45] High Ping Kicker 1.0 Shadow/Bo0m! amx_hpk.amxx running
[ 46] PsychoStats Plugin 1.1 Stormtrooper ps_heatmaps.amx running
[ 47] Show timeleft for CSDM 1.0 neygomon timer.amxx running
[ 48] Auto Kick HLTV 0.3 Subb98 auto_kick_hltv. running
[ 49] [KZ] Anti Cheat 1.0 deniS & Fame kzanticheat.amx running
[ 50] Play or Be Kicked 1.5.243 Brad Jones pbk.amxx running
[ 51] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 52] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 53] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
53 plugins, 53 running
Автор плагина
"Knife DeathMatch", "1.1", "Lucky"
Версия плагина
1.1
Исходный код
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fakemeta>

new cvar_enabled, cvar_hp, cvar_hp_hs, cvar_gamename, amx_gamename

public plugin_init()
{
register_plugin("Knife DeathMatch", "1.1", "Lucky")

register_event("DeathMsg", "on_Death", "a")
register_logevent("logevent_team_join", 3, "1=joined team")

cvar_enabled = register_cvar("amx_knifedm", "1")
cvar_hp = register_cvar("amx_knifedm_hp", "0")
cvar_hp_hs = register_cvar("amx_knifedm_hp_hs", "0")
cvar_gamename = register_cvar("amx_knifedm_gamename", "1")

if(get_pcvar_num(cvar_gamename) == 1)
{
amx_gamename = register_cvar("amx_gamename", "angerserver.ru" )
register_forward(FM_GetGameDescription, "GameDesc")
}

if(get_pcvar_num(cvar_enabled) == 1)
{
remove_entity_name("func_bomb_target")
remove_entity_name("info_bomb_target")
remove_entity_name("hostage_entity")
remove_entity_name("func_hostage_rescue")
remove_entity_name("info_hostage_rescue")
remove_entity_name("info_vip_start")
remove_entity_name("func_vip_safetyzone")
remove_entity_name("func_escapezone")

removeweapons()

server_cmd("sv_restart 2")
}
}

public logevent_team_join()
{
if(get_pcvar_float(cvar_enabled) == 1)
{
new id = get_loguser_index()
set_task(1.0, "spawn_user", id)
}
}

stock get_loguser_index()
{
static loguser[80], name[32];
read_logargv(0,loguser,79);
parse_loguser(loguser,name,31);

return get_user_index(name);
}

public on_Death()
{
if(get_pcvar_float(cvar_enabled) == 1)
{
new id = read_data(2)
set_task(1.0, "spawn_user", id)
}
}

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

ExecuteHamB(Ham_CS_RoundRespawn, id)
return PLUGIN_HANDLED
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
if(get_pcvar_float(cvar_enabled) == 1)
{
if(is_user_connected(killer))
{
if(hitplace == HIT_HEAD)
{
set_user_health(killer, get_user_health(killer) + get_pcvar_num(cvar_hp_hs))

set_hudmessage(255, 0, 0, 0.1, -1.0, 0, 6.0, 10.0)
show_hudmessage(killer, "HeadShot")
}
else
{
set_user_health(killer, get_user_health(killer) + get_pcvar_num(cvar_hp))
}
}
}
}

public client_connect(id)
{
if(get_pcvar_num(cvar_enabled) == 1)
{
set_task(20.0, "connect_ads", id)
}
}

public connect_ads(id)
{
client_print(id, print_chat, "This server is using Knife DeathMatch Mod!")
client_print(id, print_chat, "You can use only knife!")
}

public GameDesc()
{
static gamename[32]
get_pcvar_string(amx_gamename, gamename, 31)
forward_return(FMV_STRING, gamename)
return FMRES_SUPERCEDE
}

removeweapons()
{
new weapon, nnumr

while ((weapon = find_ent_by_class(-1,"armoury_entity")))
{
remove_entity(weapon)
nnumr++
}
}
Ошибка возникает не всегда, но все равно хочется чтобы а логах не было error)
 
В этой теме было размещено решение! Перейти к решению.

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
скорей всего нулевое значения появляется, т.е или не валидный идентификатор
24 Окт 2019
событие spawn не может спавнить, так как айди неверный, как то так и ошибку, не валидней айди
24 Окт 2019
нужна проверка типо:

if(id > 32 || id == 0) return PLUGIN_HANDLED

тогда spawn должен работать, или просто не будет отрабатываться событие, по условию не пройдет.
24 Окт 2019
C++:
public spawn_user(id)
{
    if(id > 32 || id == 0) return PLUGIN_HANDLED

    if(is_user_connected(id))
        if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
            return PLUGIN_HANDLED
   
    ExecuteHamB(Ham_CS_RoundRespawn, id)
    return PLUGIN_HANDLED
}
вот проверка сверху добавил.
 
Последнее редактирование:
Сообщения
321
Реакции
73
Помог
11 раз(а)
wellasgood, Благодарю) Поставил на сервер, пока что ошибки нет, но я не знаю когда она возникала.
 

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

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