Краш через плагин режима гранат

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
182
Реакции
9
Ошибка
Плагин вызывает краш сервера
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.12.0.780-dev
Build date: 16:20:56 Sep 19 2022 (3082)
ReGamedll
ReGameDLL version: 5.21.0.576-dev
Build date: 08:31:59 Mar 11 2023
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Список метамодулей
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 3] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 5] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 7] Print Center Fix RUN - printcenterfix_mm_i386.so v2.0.1 ini ANY ANY
[ 8] YaPB RUN - yapb.so v4.3.729 ini Chlvl ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.22.0.254-dev pl6 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
16 plugins, 16 running
Список плагинов
[ 1] Lite Bans 2.2 neygomon lite_bans_off.a running
[ 2] GameCMS_API 5.6.3 zhorzh78 gamecms_api_5.6 running
[ 3] [ReAPI & ZP] Simple St 0.2.5 gajerek / Mr.Bes Addon_Stats228. running
[ 4] [API] Addon: MuzzleFla 1.6 Yoshioka Haruki zp_addon_muzzle running
[ 5] [API] Addon: Smoke Wal 1.1.1 Yoshioka Haruki zp_addon_smoke_ running
[ 6] [API] Addon: Weapon Pl 1.1.1 Yoshioka Haruki addon_weapon_pl running
[ 7] Players Menu 1.7 neugomon players_menu.am running
[ 8] Rcon Shop 0.4b b0t. RconShop.amxx running
[ 9] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 10] Adverts 1.0 pUzzlik advert_zm.amxx running
[ 11] Zombie Plague 4.3 MeRcyLeZZ zombie_plague40 running
[ 12] [ZP] Buy Menu + Level 1.1 t3rkecorejz zp_buymenu_leve running
[ 13] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 14] [ZP] Human classes 0.1 Ergo proxy zp_humanclasses running
[ 15] [ZP] Default Classe 1.0 reyeska zp1.amxx running
[ 16] [ZP] Default Classe 1.0 reyeska zp2.amxx running
[ 17] [ZP] Default Classe 1.0 reyeska zp12.amxx running
[ 18] [ZP] Default Classe 1.0 reyeska zp13.amxx running
[ 19] [ZP] Default Classe 1.0 reyeska zp3.amxx running
[ 20] [ZP] Default Classe 1.0 reyeska zp4.amxx running
[ 21] [ZP] Default Classe 1.0 reyeska zp6.amxx running
[ 22] [ZP] Default Classe 1.0 reyeska zp8.amxx running
[ 23] [ZP] Default Classe 1.0 reyeska zp5.amxx running
[ 24] [ZP] Zombie Class: О� 0.4 DJHD! (Fix by Bo zp_zclass_hunte running
[ 25] unknown unknown unknown zp_zombieclasse running
[ 26] [CSO] ZClass: Shaman 1.0 ImmortalAmxx cso_class_shama running
[ 27] [ZP] ZClass: Revenant 1.0 | 2023 R1CHICOREJZ zp_zclass_rev_i running
[ 28] [ZP] Zombie Class: Dra 0.1 =), LARS-BLOODLI zp_zclass_reven running
[ 29] [CSO Like] ZClass: Ara 1.0 inf cso_zclass_spid running
[ 30] [ZP] Buy Menu Compatib 1.0 reyeska BuyMenu_Compati running
[ 31] [ZP] Extra Item: No Re 0.1.0 fezh zp_extra_no_rec running
[ 32] unknown unknown unknown zp_extra_uts15. running
[ 33] unknown unknown unknown zp_extra_item_a running
[ 34] Gilboa Viper 1.0 PbI)I(Uu' / Batc zp_gilboaex.amx running
[ 35] unknown unknown unknown zp_extra_item_e running
[ 36] unknown unknown unknown zp_extra_item_w running
[ 37] unknown unknown unknown zp_extra_item_b running
[ 38] unknown unknown unknown zp_extra_item_c running
[ 39] unknown unknown unknown zp_extra_item_m running
[ 40] unknown unknown unknown zp_extra_item_m running
[ 41] unknown unknown unknown zp_extra_item_s running
[ 42] unknown unknown unknown zp_extra_item_s running
[ 43] [ZP] Extra: CSO Weapon 1.1 KORD_12.7 Weapon_Charger5 running
[ 44] [ZP] Weapon: THANATOS- 2.0 xUnicorn (t3rkec zp_weapon_thana running
[ 45] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 Weapon_GunGnir. running
[ 46] [CSO] SG-DRILL || Magn 1.0 AsepKhairulAnam@ zp_magnumdrill. running
[ 47] [ZP] Weapon: Laser Sto 1.1 Yoshioka Haruki zp_weapon_y23s1 running
[ 48] [ZP] Weapon: SCAR OZ-C 1.0 xUnicorn (t3rkec zp_weapon_scar_ running
[ 49] [ZP] Weapon: Arbalest 1.0 Yoshioka Haruki zp_weapon_halog running
[ 50] [ZP] VIP menu 1.1 reyeska zp_vip_menu.amx running
[ 51] [ZP] Admin Menu Cool fl0wer zp_adminmenu.am running
[ 52] [ZP] Gold menu 1.1 reyeska zp_vip_gold_men running
[ 53] [ZP] Premium menu 1.1 reyeska zp_premium_menu running
[ 54] unknown unknown unknown Scar_Born_Beast running
[ 55] [ZP] Extra: CSO Weapon 1.1 KORD_12.7 weapon_dragon_a running
[ 56] unknown unknown unknown zp_extra_m32.am running
[ 57] unknown unknown unknown zp_extra_item_b running
[ 58] [ZP] Extra: M134 1.0 LARS-DAY[BR]EAKE azp_weapon_m134 running
[ 59] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 Weapon_RailGun. running
[ 60] [ZP] Weapon: Stinger 1.0.2 xUnicorn (t3rkec zp_weapon_sting running
[ 61] [ZP] Weapon: Void Aven 2.0 Yoshioka Haruki zp_weapon_voidp running
[ 62] [ZP] Weapon: IGNITE-7 1.0 Yoshioka Haruki zp_weapon_ignit running
[ 63] [ZP] Extra: Unlimited 1.0 MeRcyLeZZ cso_extra_unlim running
[ 64] [Customizable] AmxModM 0.0.5 Albertio amxmodmenu.amxx running
[ 65] Menu 1.0 reyeska menu_by_reyeska running
[ 66] unknown unknown unknown reyeska_priv.am running
[ 67] Camera Changer Lite 28.09.2022 Oli camera_changer_ running
[ 68] Donate $ 1.0 reyeska reyeska_donate. running
[ 69] [ZP] Priv Multijump 13.10.2022 Oli zp_priv_multiju running
[ 70] [ZP] Armor Limit vk/krisiso g3cKpunTop limit_armor.amx running
[ 71] CheckSteamID 1.0 ApXuTekToR CheckSteamID.am running
[ 72] Ping Kicker 0.1 Emma Jule ping.amxx running
[ 73] [ZP] Survivor and Name 1.0 O_o survivor_and_ne running
[ 74] [ZP] Addon: Perfect La 4.2 [P]erfec[T] [S]c zp_lasermine_pe running
[ 75] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 76] [ZP] Sub-Plugin: Parac 1.1 Random1, 93()|29 zp_parachute2.a running
[ 77] bazooka 2.0 Online bazooka.amxx running
[ 78] [ZP] Present 1.1 reyeska re_present.amxx running
[ 79] [AMXX] Addon: Floating 1.0v4 Yoshioka Haruki addon_floating_ running
[ 80] re_lote 1.0 reyeska re_lote.amxx running
[ 81] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 82] unknown unknown unknown present.amxx running
[ 83] [ZP] CSO Countdown 5.0 jc980 zp_cso_countdow running
[ 84] AFK Control 1.0 mx?! afk_control_zm. running
[ 85] Demo Recorder 2.4.1 F@nt0M demo_recorder.a running
[ 86] BHOP BLOCK 1.8 Leo_[BH] bhop_block.amxx running
[ 87] Gibs (No Blood) 1.0.0 fl0wer gibs_noblood.am running
[ 88] [ZP] Auto Respawn 06.10.2022 Oli zp_join_respawn running
[ 89] Lite MapChooser 2.6 neygomon mapchooser.amxx running
[ 90] Block Manager 1.1 maFFyoZZyk block_manager.a running
[ 91] [AMXX] Grenade Mode 0.2 Flymic24 amx_granade_mode.amxx running
[ 92] ChatAdditions: Core v1.9.1 Sergey Shorokhov ChatAdditions_C running
[ 93] ChatAdditions: GameCMS 0ef9f6f Sergey Shorokhov CA_Storage_Game running
[ 94] CA: Mute v1.9.1 Sergey Shorokhov CA_Mute.amxx running
[ 95] CA: Gag v1.9.1 Sergey Shorokhov CA_Gag.amxx running
[ 96] Lite Translit 2.8 neygomon lite_translit.a running
96 plugins, 96 running
Автор плагина
Flymic24
Версия плагина
0.2
Исходный код
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#include < reapi >
#include < xs >
#include < engine >

#define REMOVE_NOT_CONNECT // Удалять или активировать при выходе/смерти владельца гранаты
#define RADIUS_SENSOR 100.0 // Радиус срабатывания сенсорной мины
#define MOTION_SPEED 150.0 // Порог скорости срабатывания датчика движения

#define HOMING_TIME 3.0 // Время приследования
#define RADIUS_HOMING 500.0 // Радиус приследования
#define SPEED_HOMING 400.0 // скорость приследования

enum _:eExpType {
Norm, Touch, Mine, Sensor, InpulseE, Motion, Homing
};

new szExpName[eExpType][] = {
"Нормальный", "Столкновение", "Мина", "Сенсорная", "Взрыв на Е", "Датчик движения", "Преследование"
};

new g_iSensorSpr;

new const GrenadeClassNames[][] = {
"weapon_flashbang", "weapon_hegrenade", "weapon_smokegrenade"
};

public plugin_init()
{
register_plugin
(
"[AMXX] Grenade Mode",
"0.2",
"Flymic24"
);

for(new i; i < sizeof GrenadeClassNames; i++) {
RegisterHam(Ham_Item_Deploy, GrenadeClassNames[i], "HamHook_Item_Deploy", .Post = true);
RegisterHam(Ham_Weapon_SecondaryAttack, GrenadeClassNames[i], "HamHook_Item_SecondaryAttack", .Post = false);
RegisterHam(Ham_Spawn, GrenadeClassNames[i], "HamHook_Item_Spawn", .Post = false);
}

RegisterHookChain(RG_CBasePlayer_ThrowGrenade, "CBasePlayer_ThrowGrenade", .post = true);

RegisterHam(Ham_Think, "grenade", "HamHook_ThinkGrenade", .Post = false);
RegisterHam(Ham_Touch, "grenade", "HamHook_TouchGrenade", .Post = false);
}

public plugin_precache() {
server_print("precaching model sprites/shockwave.spr")
g_iSensorSpr = precache_model("sprites/shockwave.spr");
}

public HamHook_Item_Deploy(const pItem) {
server_print("HamHook_Item_Deploy | m_pPlayer checking")
new iPlayer = get_member(pItem, m_pPlayer);
server_print("HamHook_Item_Deploy | m_pPlayer sent: %d", iPlayer)
server_print("HamHook_Item_Deploy | var_weapons checking")
new iType = get_entvar(pItem, var_weapons);
server_print("HamHook_Item_Deploy | var_weapons sent: %d", iType)

client_print(iPlayer, print_center, "Режим: %s", szExpName[iType]);
}

public HamHook_Item_SecondaryAttack(const pItem) {
server_print("HamHook_Item_SecondaryAttack | Read m_Weapon_flNextSecondaryAttack in pItem. Data: %d", get_member(pItem, m_Weapon_flNextSecondaryAttack))
if (get_member(pItem, m_Weapon_flNextSecondaryAttack) > 0.0)
return HAM_IGNORED;

server_print("HamHook_Item_SecondaryAttack | Write m_Weapon_flNextSecondaryAttack in pItem")
set_member(pItem, m_Weapon_flNextSecondaryAttack, 0.3);

server_print("HamHook_Item_SecondaryAttack | Checking m_pPlayer")
new iPlayer = get_member(pItem, m_pPlayer);
server_print("HamHook_Item_SecondaryAttack | m_pPlayer sent: %d", iPlayer)
server_print("HamHook_Item_SecondaryAttack | Checking var_weapons")
new iType = get_entvar(pItem, var_weapons);
server_print("HamHook_Item_SecondaryAttack | var_weapons sent: %d", iType)

if (++iType >= eExpType) iType = Norm;
server_print("HamHook_Item_SecondaryAttack | Set var_weapons")
set_entvar(pItem, var_weapons, iType);

client_print(iPlayer, print_center, "Режим: %s", szExpName[iType]);

return HAM_IGNORED;
}

public CBasePlayer_ThrowGrenade(const pPlayer, const pWeapon, Float:vecSrc[3], Float:vecThrow[3], Float:time, const usEvent) {
server_print("CBasePlayer_ThrowGrenade | ATYPE_INTEGER сhecking")
new pGrenade = GetHookChainReturn(ATYPE_INTEGER);
server_print("CBasePlayer_ThrowGrenade | ATYPE_INTEGER sent: %d", pGrenade)
if (is_nullent(pGrenade))
return HC_CONTINUE;

new iType = get_entvar(pWeapon, var_weapons);
set_entvar(pGrenade, var_weapons, iType);

new Float:fGameTime = get_gametime();

switch(iType) {
case Mine: {
set_entvar(pGrenade, var_solid, SOLID_TRIGGER);
set_entvar(pGrenade, var_dmgtime, fGameTime + 9999.0);

new Float:flAngles[3]; flAngles[1] = random_float(-360.0, 360.0);
set_entvar(pGrenade, var_angles, flAngles);
}
case InpulseE, Sensor, Motion: {
set_entvar(pGrenade, var_dmgtime, fGameTime + 9999.0);
set_entvar(pGrenade, var_teleport_time, fGameTime + 1.0);
}
case Homing: {
set_entvar(pGrenade, var_dmgtime, fGameTime + HOMING_TIME);
}
}

return HC_CONTINUE;
}

public HamHook_Item_Spawn(const pItem) {
set_entvar(pItem, var_weapons, Norm);
}

public HamHook_TouchGrenade(const iEnt, const iToucher) {
if (get_member(iEnt, m_Grenade_bIsC4))
return HAM_IGNORED;

new iType = get_entvar(iEnt, var_weapons);
new iOwner = get_entvar(iEnt, var_owner);

switch(iType) {
case Touch: {
return ActiveGrenade(iEnt);
}
case Mine, Homing: {
if (!is_user_alive(iToucher) || !is_user_alive(iOwner))
return HAM_IGNORED;

if (get_member(iToucher, m_iTeam) == get_member(iOwner, m_iTeam))
return HAM_IGNORED;

if (iType == Mine && !(get_entvar(iEnt, var_flags) & FL_ONGROUND))
return HAM_IGNORED;

return ActiveGrenade(iEnt);
}
}

return HAM_IGNORED;
}

public HamHook_ThinkGrenade(iEnt) {
if(!is_valid_ent(iEnt)) return HAM_IGNORED;

if (get_member(iEnt, m_Grenade_bIsC4))
return HAM_IGNORED;

new iType = get_entvar(iEnt, var_weapons);
new iOwner = get_entvar(iEnt, var_owner);

if(!is_user_alive(iOwner)) {
#if defined REMOVE_NOT_CONNECT
set_entvar(iEnt, var_flags, get_entvar(iEnt, var_flags) | FL_KILLME);
return HAM_IGNORED;
#else
return ActiveGrenade(iEnt);
#endif
}

if (get_member(iEnt, m_Grenade_bDetonated))
return HAM_IGNORED;

new iOwnerTeam = get_member(iOwner, m_iTeam);
new _Victim = NULLENT;
new Float:fVecOrigin[3]; get_entvar(iEnt, var_origin, fVecOrigin);
new Float:fVecVelocity[3];

switch(iType) {
case InpulseE: {
if (get_entvar(iOwner, var_button) & IN_USE) {
return ActiveGrenade(iEnt);
}
}
case Sensor, Motion: {
if (get_entvar(iEnt, var_flags) & FL_ONGROUND) {
new Float:fGameTime = get_gametime();
while ((_Victim = engfunc(EngFunc_FindEntityInSphere, _Victim, fVecOrigin, RADIUS_SENSOR)) != 0) {
if(!is_user_alive(_Victim)) continue;
if (get_member(_Victim, m_iTeam) == iOwnerTeam) continue;

if (iType == Motion) {
get_entvar(_Victim, var_velocity, fVecVelocity);
if (xs_vec_len(fVecVelocity) < MOTION_SPEED) continue;
}

return ActiveGrenade(iEnt);
}
if(get_entvar(iEnt, var_teleport_time) < fGameTime) {
MSG_TE_BEAMCYLINDER(fVecOrigin, iType != Motion ? {255, 100, 255} : {255, 0, 0});

set_entvar(iEnt, var_teleport_time, fGameTime + 1.0);
}
}
}
case Homing: {
_Victim = get_entvar(iEnt, var_enemy);
new Float:fVecOriginTarget[3];
if (is_nullent(_Victim)) {
_Victim = NULLENT;
new Float:fDistance = RADIUS_HOMING;
new Float:fNewDistance;
while ((_Victim = engfunc(EngFunc_FindEntityInSphere, _Victim, fVecOrigin, fDistance)) != 0) {
if(!is_user_alive(_Victim)) continue;
if (get_member(_Victim, m_iTeam) == iOwnerTeam) continue;

get_entvar(_Victim, var_origin, fVecOriginTarget);

fNewDistance = vector_distance(fVecOriginTarget, fVecOrigin);

if(fNewDistance < fDistance) {
fDistance = fNewDistance
set_entvar(iEnt, var_enemy, _Victim);
}
}
}
else {
entity_set_follow(iEnt, _Victim, SPEED_HOMING);
}
}
}

return HAM_IGNORED;
}

MSG_TE_BEAMCYLINDER(Float: fVecOrigin[3], RGB[3]) {
message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, fVecOrigin, 0);
write_byte(TE_BEAMCYLINDER);
write_coord_f(fVecOrigin[0]);
write_coord_f(fVecOrigin[1]);
write_coord_f(fVecOrigin[2]);
write_coord_f(fVecOrigin[0] + 30.0);
write_coord_f(fVecOrigin[1]);
write_coord_f(fVecOrigin[2] + RADIUS_SENSOR);
write_short(g_iSensorSpr);
write_byte(0);
write_byte(1);
write_byte(6);
write_byte(1);//hight
write_byte(1);
write_byte(RGB[0]);//red
write_byte(RGB[1]);//green
write_byte(RGB[2]);//blue
write_byte(255);
write_byte(0);
message_end();
}

ActiveGrenade(iEnt) {
if(get_member(iEnt, m_Grenade_bIsC4)) {
set_member(iEnt, m_Grenade_flC4Blow, 0.0);
}
else {
if (GetGrenadeType(iEnt) == WEAPON_SMOKEGRENADE)
set_entvar(iEnt, var_flags, get_entvar(iEnt, var_flags) | FL_ONGROUND);

set_entvar(iEnt, var_dmgtime, 0.0);
}

set_member(iEnt, m_Grenade_bDetonated, true);

dllfunc(DLLFunc_Think, iEnt);

return HAM_SUPERCEDE;
}

stock entity_set_follow(entity, target, Float:fSpeed)
{
if ( is_nullent(entity) || !is_user_alive(target) )
return

new Float:fl_Origin[3], Float:fl_EntOrigin[3]
get_entvar(target, var_origin, fl_Origin)
get_entvar(entity, var_origin, fl_EntOrigin)

new Float:fl_InvTime = (fSpeed / vector_distance(fl_Origin, fl_EntOrigin))

new Float:fl_Distance[3]
fl_Distance[0] = fl_Origin[0] - fl_EntOrigin[0]
fl_Distance[1] = fl_Origin[1] - fl_EntOrigin[1]
fl_Distance[2] = fl_Origin[2] - fl_EntOrigin[2]

new Float:fl_Velocity[3]
fl_Velocity[0] = fl_Distance[0] * fl_InvTime
fl_Velocity[1] = fl_Distance[1] * fl_InvTime
fl_Velocity[2] = fl_Distance[2] * fl_InvTime

set_entvar(entity, var_velocity, fl_Velocity)

new Float:fl_NewAngle[3]
vector_to_angle(fl_Velocity, fl_NewAngle)
set_entvar(entity, var_angles, fl_NewAngle)
}
Ошибок по плагину нету
при краше только вот это в sys_error.log

(map "zm_assault") SV_ClipToLinks: Trigger in clipping list
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
658
Реакции
563
Предупреждения
8
Помог
9 раз(а)
105 set_entvar(pGrenade, var_solid, SOLID_TRIGGER);

Уберите это. Тач должен работать и без него
 
Сообщения
658
Реакции
563
Предупреждения
8
Помог
9 раз(а)
BalbuR, надо копаться в исходниках рехлдс. Ответ лежит там
 
Статус
В этой теме нельзя размещать новые ответы.

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

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