Server crash

Сообщения
27
Реакции
0
Ошибка
CRASH: Fri Apr 22 15:24:07 UTC 2022
Start Line: ./hlds_linux -pidfile hlds_27019 -game cstrike -secure +port 27019 +sv_lan 0 +maxplayers 16 +map zm_ugc2 +sys_ticrate 500 -pingboost 2 -norestart -debug
[New LWP 23]
[New LWP 25]
[New LWP 26]
[New LWP 31]
[New LWP 34]
[New LWP 30]
[New LWP 35]
[New LWP 24]
[New LWP 32]
[New LWP 33]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./hlds_linux -pidfile hlds_27019 -game cstrike -secure +port 27019 +sv_lan 0 +m'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xf295a70a in SV_StudioSetupBones(model_s*, float, int, float const*, float const*, unsigned char const*, unsigned char const*, int, edict_s const*) () from /home/container/cstrike/dlls/cs.so
[Current thread is 1 (Thread 0xf7b85700 (LWP 23))]
#0 0xf295a70a in SV_StudioSetupBones(model_s*, float, int, float const*, float const*, unsigned char const*, unsigned char const*, int, edict_s const*) () from /home/container/cstrike/dlls/cs.so
#1 0xf7565b6a in R_StudioHull () from /home/container/engine_i486.so
#2 0xf2f2597c in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
No symbol table info available.
From To Syms Read Shared Object Library
0xf7f4dad0 0xf7f4eaa4 Yes (*) /lib/i386-linux-gnu/libdl.so.2
0xf7ec0914 0xf7f06c78 Yes ./libstdc++.so.6
0xf7d81590 0xf7e418f5 Yes (*) /lib/i386-linux-gnu/libm.so.6
0xf7bb4610 0xf7d01376 Yes (*) /lib/i386-linux-gnu/libc.so.6
0xf7f60ab0 0xf7f7b8bb Yes (*) /lib/ld-linux.so.2
0xf7b88e04 0xf7b98490 Yes ./libgcc_s.so.1
0xf74a91d0 0xf7598e90 Yes (*) /home/container/engine_i486.so
0xf746c910 0xf74703a4 Yes (*) /lib/i386-linux-gnu/librt.so.1
0xf745a5c0 0xf7464d74 Yes (*) ./libsteam_api.so
0xf743c9d0 0xf744c29f Yes (*) /lib/i386-linux-gnu/libpthread.so.0
0xf7412e00 0xf742e838 Yes (*) /home/container/filesystem_stdio.so
0xf5560000 0xf6b9d024 Yes (*) /home/container/.steam/sdk32/steamclient.so
0xf2c0fbb0 0xf2c16564 Yes (*) /lib/i386-linux-gnu/libnss_files.so.2
0xf2bb7740 0xf2bf8cb0 Yes (*) /home/container/./cstrike/addons/metamod/metamod_i386.so
0xf2953500 0xf2aea6b0 Yes (*) /home/container/cstrike/dlls/cs.so
0xf263aa20 0xf269ddb7 Yes (*) /home/container/cstrike/addons/amxmodx/dlls/amxmodx_mm_i386.so
0xf2612b90 0xf261c2f0 Yes (*) /home/container/cstrike/addons/resemiclip/resemiclip_mm_i386.so
0xf25086e0 0xf2570954 Yes (*) /home/container/cstrike/addons/podbot/podbot_mm_i386.so
0xf2494b60 0xf24dc624 Yes (*) cstrike/addons/amxmodx/modules/hamsandwich_amxx_i386.so
0xf2403120 0xf2409404 Yes (*) cstrike/addons/amxmodx/modules/csx_amxx_i386.so
0xf23c19d0 0xf23edd6c Yes (*) cstrike/addons/amxmodx/modules/fakemeta_amxx_i386.so
0xf238dd50 0xf239d460 Yes (*) cstrike/addons/amxmodx/modules/cstrike_amxx_i386.so
0xf2060790 0xf20f8fc5 Yes (*) cstrike/addons/amxmodx/modules/mysql_amxx_i386.so
0xf1ec43b0 0xf1f0bda0 Yes (*) cstrike/addons/amxmodx/modules/reapi_amxx_i386.so
0xf2031660 0xf2035f84 Yes (*) cstrike/addons/amxmodx/modules/fun_amxx_i386.so
0xf1e87290 0xf1e9380c Yes (*) cstrike/addons/amxmodx/modules/engine_amxx_i386.so
0xef14a000 0xf07580c4 Yes (*) ./steamclient.so
0xf1828670 0xf189e020 Yes (*) ./crashhandler.so
0xf1813b70 0xf1816ad4 Yes (*) /lib/i386-linux-gnu/libnss_dns.so.2
0xf17fd660 0xf18093f4 Yes (*) /lib/i386-linux-gnu/libresolv.so.2
(*): Shared library is missing debugging information.
Stack level 0, frame at 0xffbf81b0:
eip = 0xf295a70a in SV_StudioSetupBones(model_s*, float, int, float const*, float const*, unsigned char const*, unsigned char const*, int, edict_s const*); saved eip = 0xf7565b6a
called by frame at 0xffbf81c4
Arglist at 0xffbf81a8, args:
Locals at 0xffbf81a8, Previous frame's sp is 0xffbf81b0
Saved registers:
ebp at 0xffbf81a8, eip at 0xffbf81ac
End of crash report
----------------------------------------------
ОС
Linux
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 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.776-dev
Build date: 19:37:50 Apr 20 2022 (2930)
Build from: https://github.com/dreamstalker/rehlds/commit/3dc9f8c
ReGamedll
ReGameDLL version: 5.21.0.546-dev
Build date: 15:32:48 Dec 28 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/09a6c61
Версия Metamod
Metamod-r v1.3.0.86, API (5:13)
Metamod-r build: 16:14:43 Nov 15 2017
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/5b7fe14
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 2] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 3] POD-Bot mm RUN - podbot_mm_i386.s vV3B22 ini Chlvl ANY
[ 4] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl1 ANY ANY
[ 5] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl1 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl1 ANY ANY
[ 7] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl1 ANY ANY
[ 8] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl1 ANY ANY
[ 9] ReAPI RUN - reapi_amxx_i386. v5.21.0. pl1 ANY Never
[10] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl1 ANY ANY
[11] Engine RUN - engine_amxx_i386 v1.9.0.5 pl1 ANY ANY
11 plugins, 11 running
Список плагинов
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
[ 25] [ZP] Core/Engine 5.0.8 ZP Dev Team zp50_core.amxx running
[ 33] [AMXX] Settings API 1.0 MeRcyLeZZ amx_settings_ap running
[ 34] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 35] [CS] Teams API 1.2 WiLS cs_teams_api.am running
[ 36] [CS] MaxSpeed API 1.0 WiLS cs_maxspeed_api running
[ 37] [CS] Weapon Models API 1.1 WiLS cs_weap_models_ running
[ 38] [CS] Weapons Restrict 0.4 WiLS cs_weap_restric running
[ 39] [CS] Ham Hooks for Bot 1.0 WiLS cs_ham_bots_api running
[ 40] [ZP] Class: Zombie 5.0.8 ZP Dev Team zp50_class_zomb running
[ 41] [ZP] Class: Human 5.0.8 ZP Dev Team zp50_class_huma running
[ 42] [ZP] Class: Nemesis 5.0.8 ZP Dev Team zp50_class_neme running
[ 43] [ZP] Class: Survivor 5.0.8 ZP Dev Team zp50_class_surv running
[ 44] [ZP] Class: Sniper 5.0.8 ZP Dev Team zp50_class_snip running
[ 45] [ZP] Class: Zombie: Cl 5.0.8 ZP Dev Team zp50_class_zomb running
[ 46] [ZP] Class: Zombie: Ra 5.0.8 ZP Dev Team zp50_class_zomb running
[ 47] [ZP] Class: Zombie: Fa 5.0.8 ZP Dev Team zp50_class_zomb running
[ 48] [ZP] Class: Zombie: Le 5.0.8 ZP Dev Team zp50_class_zomb running
[ 49] [ZP] Class : Brute Mot 1.1.0 schmurgel1983 zp_zclass_brute running
[ 50] [ZP] Class Smoker 1.3.1 4eRT zp_zclass_smoke running
[ 51] [ZP] Zombie Class: Pre 1.0 zmd94 predator_zombie running
[ 52] [ZP] Class : Leap Zomb 1.4.2 Fry! zp_zlongjump.am running
[ 53] [ZP] Reflects Zombies 1.0 MaTeO zp_class_reflec running
[ 54] [ZP] Class: Human: Cla 5.0.8 ZP Dev Team zp50_class_huma running
[ 55] [ZP] Human Armor 5.0.8 ZP Dev Team zp50_human_armo running
[ 56] [ZP] Game Modes Manage 5.0.8 ZP Dev Team zp50_gamemodes. running
[ 57] [ZP] Addon: Display th 0.1.6 meTaLiCroSS zp_addon_dtcm.a running
[ 59] [ZP] Game Mode: Infect 5.0.8 ZP Dev Team zp50_gamemode_i paused
[ 60] [ZP] Game Mode: Multip 5.0.8 ZP Dev Team zp50_gamemode_m paused
[ 61] [ZP] Game Mode: Swarm 5.0.8 ZP Dev Team zp50_gamemode_s running
[ 62] [ZP] Game Mode: Nemesi 5.0.8 ZP Dev Team zp50_gamemode_n paused
[ 63] [ZP] Game Mode: Surviv 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 64] [ZP] Game Mode: sniper 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 66] [ZP] Game Mode: Plague 5.0.8 ZP Dev Team zp50_gamemode_p paused
[ 67] [ZP] Items Manager 5.0.8 ZP Dev Team zp50_items.amxx running
[ 68] [ZP] Items Manager: Am 5.0.8 ZP Dev Team zp50_items_ammo running
[ 69] [ZP] Item: Nightvision 5.0.8 ZP Dev Team zp50_item_night running
[ 70] [ZP] Item: Antidote 5.0.8 ZP Dev Team zp50_item_antid running
[ 71] [ZP] Item: Zombie Madn 5.0.8 ZP Dev Team zp50_item_zombi running
[ 72] [ZP] Item: Infection B 5.0.8 ZP Dev Team zp50_item_infec running
[ 73] [ZP] Item: Weapons 5.0.8 ZP Dev Team zp50_item_weapo running
[ 75] [ZP] Extra: Anti-Infec 1.0 MeRcyLeZZ zp_extra_human_ running
[ 76] ZM VIP 1.7.2 aaarnas zm_vip.amxx running
[ 81] [ZP] Extra Item: Multi 1.0 pharse zp_extra_multij running
[ 86] [ZP] WPN Minigun 1.65 CLLlAgOB zp_extra_minigu running
[ 88] [ZP] Extra Item: Rock 1.1 CrazY zp50_extra_rock running
[ 94] [ZP] Admin Menus 5.0.8 ZP Dev Team zp50_admin_menu running
[ 95] [ZP] Admin Models 5.0.8 ZP Dev Team zp50_admin_mode running
[ 96] [ZP] Custom Buy Menus 5.0.8 ZP Dev Team zp50_buy_menus. running
[ 97] [ZP] Buyzones 5.0.8 ZP Dev Team zp50_buy_zones. running
[ 98] [ZP] Rewards: Ammo Pac 5.0.8 ZP Dev Team zp50_rewards_am running
[ 99] [ZP] Rewards: Frags & 5.0.8 ZP Dev Team zp50_rewards_fr running
[100] [ZP] Deathmatch 5.0.8 ZP Dev Team zp50_deathmatch running
[101] [ZP] Random Spawning 5.0.8 ZP Dev Team zp50_random_spa running
[102] [ZP] Spawn Protection 5.0.8 ZP Dev Team zp50_spawn_prot running
[103] [ZP] Zombie Features 5.0.8 ZP Dev Team zp50_zombie_fea running
[104] [ZP] Zombie Sounds 5.0.8 ZP Dev Team zp50_zombie_sou running
[105] [ZP] Zombie Damage 5.0.8 ZP Dev Team zp50_zombie_dam running
[106] [ZP] Human Unlimited A 5.0.8 ZP Dev Team zp50_human_ammo running
[107] [ZP] Flashlight 5.0.8 ZP Dev Team zp50_flashlight running
[108] [ZP] Nightvision 5.0.8 ZP Dev Team zp50_nightvisio running
[109] [ZP] Leap/Longjump 5.0.8 ZP Dev Team zp50_leap.amxx running
[110] [ZP] Pain Shock Free 5.0.8 ZP Dev Team zp50_painshockf running
[111] [ZP] Knockback 5.0.8 ZP Dev Team zp50_knockback. running
[112] [ZP] Weapon Drop/Strip 5.0.8 ZP Dev Team zp50_weapon_dro running
[113] [ZP] Effects: Infect 5.0.8 ZP Dev Team zp50_effects_in running
[114] [ZP] Effects: Cure 5.0.8 ZP Dev Team zp50_effects_cu running
[115] [ZP] Effects: Lighting 5.0.8 ZP Dev Team zp50_effects_li running
[116] [ZP] Ambience Effects 5.0.8 ZP Dev Team zp50_ambience_e running
[117] [ZP] Ambience Sonds 5.0.8 ZP Dev Team zp50_ambience_s running
[118] [ZP] Main Menu 5.0.8 ZP Dev Team zp50_main_menu. running
[119] [ZP] Objective Remover 5.0.8 ZP Dev Team zp50_objective_ running
[120] [ZP] Gameplay Fixes 5.0.8 ZP Dev Team zp50_gameplay_f running
[121] [ZP] Team Scoring 5.0.8 ZP Dev Team zp50_team_scori running
[122] [ZP] HUD Information 5.0.8 ZP Dev Team zp50_hud_info.a running
[123] [ZP] Server Browser In 5.0.8 ZP Dev Team zp50_serverbrow running
[124] [ZP] Ammo Packs 5.0.8 ZP Dev Team zp50_ammopacks. running
[126] NadeModes 11.2 Nomexous & OT nademodes.amxx running
[127] [ZP] Grenade: Fire 5.0.8 ZP Dev Team zp50_grenade_fi running
[128] [ZP] Grenade: Frost 5.0.8 ZP Dev Team zp50_grenade_fr running
[129] [ZP] Grenade: Flare 5.0.8 ZP Dev Team zp50_grenade_fl running
[130] [ZP] ZP 4.3 Subplugin 5.0.8 ZP Dev Team zp50_zp43_compa running
130 plugins, 124 running
Автор плагина
CLLlAgOB
Версия плагина
1.65
Исходный код
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>
#include <zp50_class_sniper>
//#include <fun>
#include < xs >
#include < reapi >

#pragma compress 1

#define MAX_PLAYERS 32
#define MAX_BLOOD_DISTANCE 64
#define LOADUP_TIME 0.75
#define SHUTDOWN_TIME 1.7
#define SHAKE_FORCE -5.0 //(must be negative value)


native zp_has_user_antidotegun(id);


new const GUNSHOT_DECALS[] = {41, 42, 43, 44, 45} // Gunshot decal list
// Plugin information
new const PLUGIN[] = "[ZP] WPN Minigun"
new const VERSION[] = "1.65"
new const AUTHOR[] = "CLLlAgOB"
// Weapon information
new const g_item_name[] = { "MiniGUN!" }
const g_item_cost = 30

new const weapon_name[] = "weapon_m249";
// other
new bool:has_minigun[33], m249, bool:atk2[33], bool:atk1[33],bool:delay[33],bool:beackup[33],
clipp[33],clipstart,g_itemid_minigun,g_fwid,g_guns_eventids_bitsum,bool:g_fix_punchangle[33],
bool:frstCLIP[33],g_MaxPlayers, Float:g_lastShot[33], g_normal_trace[33],DMGMG,bool:haswhpnnmg[33],
Float:g_nextSound[33], g_plAction[33],bool:canfire[33],oneround,bool:user_bot[33],bool:delayhud[33],
clipstartsuv,bool:survivor[33],bool:is_alive[33],bool:is_connected[33]
// Blood
new g_blood
new g_bloodspray
// CS Player PData Offsets (win32)
const OFFSET_CSTEAMS = 114
// Linux diff's
const OFFSET_LINUX = 5 // offsets 5 higher in Linux builds
// Models
new P_MODEL[] = "models/wpnmod/m134/p_minigun.mdl"
new V_MODEL[] = "models/wpnmod/m134/v_minigun.mdl"
new W_MODEL[] = "models/wpnmod/m134/w_minigun.mdl"
// Sounds
new m_SOUND[][] = {"wpnmod/minigun/hw_shoot1.wav", "wpnmod/minigun/hw_spin.wav", "wpnmod/minigun/hw_spinup.wav", "wpnmod/minigun/hw_spindown.wav"}
new g_noammo_sounds[][] = {"weapons/dryfire_rifle.wav"}
//no recoil
new const g_guns_events[][] = {"events/m249.sc"}
//connect valid?
#define is_user_valid_connected(%1) (1 <= %1 <= g_MaxPlayers && is_connected[%1])

enum {
anim_idle,
anim_idle2,
anim_gentleidle,
anim_stillidle,
anim_draw,
anim_holster,
anim_spinup,
anim_spindown,
anim_spinidle,
anim_spinfire,
anim_spinidledown
}

// Types
enum {
act_none,
act_load_up,
act_run
}

public plugin_precache() {
precache_model(P_MODEL)
precache_model(V_MODEL)
precache_model(W_MODEL)
precache_sound(m_SOUND[0])
precache_sound(m_SOUND[1])
precache_sound(m_SOUND[2])
precache_sound(m_SOUND[3])
g_blood = precache_model("sprites/blood.spr")
g_bloodspray = precache_model("sprites/bloodspray.spr")
g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1)
}

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
clipstart = register_cvar("amx_ammo_m249","600")
clipstartsuv = register_cvar("amx_ammosuv_m249","10000")
m249 = register_cvar("amx_minigun_speed","0.7")
DMGMG = register_cvar("amx_minigun_damage","1.25")
oneround = register_cvar("amx_oneround","0")
g_itemid_minigun = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
register_event("CurWeapon","event_curweapon","be", "1=1")
register_event("DeathMsg","unminigun","a")
register_forward(FM_ClientDisconnect, "fw_ClientDisconnect")
register_forward(FM_CmdStart, "fwd_CmdStart")
register_forward(FM_EmitSound,"fwd_emitsound")
register_forward(FM_PlaybackEvent, "fwPlaybackEvent")
register_forward(FM_PlayerPostThink, "fwPlayerPostThink", 1)
register_forward(FM_StartFrame, "fwd_StartFrame")
register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1)
//RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
//RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
//RegisterHam(Ham_TakeDamage, "player", "player_TakeDamage")
RegisterHookChain( RG_CBasePlayer_Killed, "fw_PlayerKilled");
RegisterHookChain( RG_CBasePlayer_Spawn, "fw_PlayerSpawn_Post", true );
RegisterHookChain( RG_CBasePlayer_TakeDamage, "player_TakeDamage" );
register_clcmd("drop","dropcmd", 0)
g_MaxPlayers = get_maxplayers()
//events
register_logevent("event_start", 2, "1=Round_Start")
register_event("TextMsg", "fwEvGameWillRestartIn", "a", "2=#Game_will_restart_in")
register_event("HLTV", "event_start_freezetime", "a", "1=0", "2=0")
unregister_forward(FM_PrecacheEvent, g_fwid, 1)
}

public plugin_natives() {
register_native("zp_has_user_minigun", "native_zp_has_user_minigun")
}

public native_zp_has_user_minigun( plugin, argc ){
return has_minigun[get_param(1)]
}
// Client joins the game
public client_putinserver(id)
{
// Player joined
is_connected[id] = true
}
// Client leaving
public fw_ClientDisconnect(id)
{
is_connected[id] = false
is_alive[id] = false
}
public fw_PlayerSpawn_Post(id)
{
// Not alive or didn't join a team yet
if (!is_user_alive(id) || !get_member(id,m_iTeam))
return;
// Player spawned
is_alive[id] = true
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
//player die
is_alive[victim] = false
}

public unminigun(){
new id = read_data(2)
if(has_minigun[id] && !is_alive[id]) {
new Float:Aim[3],Float:origin[3]
velocity_by_aim(id, 64, Aim)
get_entvar( id, var_origin, origin );
//entity_get_vector(id,EV_VEC_origin,origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

new minigun = rg_create_entity("info_target")
set_entvar( minigun, var_classname, "minigun" );
//entity_set_string(minigun,EV_SZ_classname,"minigun")
engfunc( EngFunc_SetModel, minigun, W_MODEL );
//entity_set_model(minigun,W_MODEL)

set_entvar( minigun, var_solid, 1 );
set_entvar( minigun, var_mins, Float:{-2.0,-2.0,-2.0} );
set_entvar( minigun, var_maxs, Float:{5.0,5.0,5.0})
// entity_set_size(minigun,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
// entity_set_int(minigun,EV_INT_solid,1)
set_entvar( minigun, var_movetype, 6 );
set_entvar( minigun, var_iuser1, clipp[id]);
set_entvar( minigun, var_origin, origin );
// entity_set_int(minigun,EV_INT_movetype,6)
// entity_set_int(minigun, EV_INT_iuser1, clipp[id])
// entity_set_vector(minigun,EV_VEC_origin,origin)
has_minigun[id] = false
remowegun(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

//damage lvl
public player_TakeDamage(victim, inflictor, attacker, Float:damage, damagetype) {
if(damagetype & DMG_BULLET && haswhpnnmg[attacker] && has_minigun[attacker] == true && attacker!=victim)
{
damage = damage*get_pcvar_float(DMGMG)
SetHookChainArg( 4, ATYPE_FLOAT, damage );
//SetHamParamFloat(4, damage)
return HC_CONTINUE
}
return HC_CONTINUE
}


public event_start_freezetime(){
remove_miniguns()
static iPlayers[32], iPlayersNum, i
get_players(iPlayers, iPlayersNum, "a")
if(get_pcvar_num(oneround)){
for (i = 0; i <= iPlayersNum; ++i){
if(has_minigun[iPlayers[i]]){
has_minigun[iPlayers[i]] = false
remowegun(iPlayers[i])
removesuv(iPlayers[i])
}
}
} else {
for (i = 0; i <= iPlayersNum; ++i){
g_plAction[iPlayers[i]] = false
canfire[iPlayers[i]] = false
frstCLIP[iPlayers[i]] = true
set_task(0.1,"event_curweapon",iPlayers[i])
removesuv(iPlayers[i])
}
}
}

public removesuv(id){
if(survivor[id]){
has_minigun[id] = false
survivor[id] = false
remowegun(id)
}
}

// remove gun and save all guns
public remowegun(id) {
rg_remove_item( id, weapon_name, true );
/*new wpnList[32]
new number
get_user_weapons(id,wpnList,number)
for (new i = 0;i < number ;i++) {
if (wpnList[i] == CSW_M249) {

fm_strip_user_gun(id, wpnList[i])
}
}*/
}

public event_start(){
static iPlayers[32], iPlayersNum, i
get_players(iPlayers, iPlayersNum, "a")
for (i = 0; i <= iPlayersNum; ++i)
canfire[iPlayers[i]] = true
}



public fwEvGameWillRestartIn() {
static iPlayers[32], iPlayersNum, i
get_players(iPlayers, iPlayersNum, "a")
for (i = 0; i <= iPlayersNum; ++i)
has_minigun[iPlayers[i]] = false
}
public client_connect(id){
canfire[id]= false
has_minigun[id] = false
g_normal_trace[id] = 0
if(is_user_bot(id)) user_bot[id] = true
else user_bot[id] = false
}

//block sound no ammo in atack
public fwd_emitsound(id, channel, sample[], Float:volume, Float:attn, flag, pitch)
{
if (!is_user_valid_connected(id) || !has_minigun[id])
return FMRES_IGNORED;
else if((equal(sample, g_noammo_sounds[0])) && has_minigun[id] && haswhpnnmg[id])
{
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}

// someone bought our extra item
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_itemid_minigun) {
// if(zp_has_user_antidotegun(id)) {
// client_print(id, print_chat, "[ZP] You cannot buy a minigun when you have an antidote gun.")
// return PLUGIN_HANDLED;
// }
give_weapon(id,0,1)
}
return PLUGIN_CONTINUE;
}
//infect plaer
public zp_user_infected_pre(player, infector){
has_minigun[player] = false
dropcmddir(player)
}

public dropcmd(id) {
if(zp_class_sniper_get(id) && is_alive[id])
{
client_print(id, print_center, "This weapon cannot be dropped!");
}
if(has_minigun[id] && haswhpnnmg[id] && is_alive[id]) {
new Float:Aim[3],Float:origin[3]
velocity_by_aim(id, 64, Aim)

get_entvar( id, var_origin, origin );

origin[0] += Aim[0]
origin[1] += Aim[1]

new minigun = rg_create_entity("info_target")
set_entvar( minigun, var_classname, "minigun" );
//entity_set_string(minigun,EV_SZ_classname,"minigun")
engfunc( EngFunc_SetModel, minigun, W_MODEL );
//entity_set_model(minigun,W_MODEL)

set_entvar( minigun, var_solid, 1 );
set_entvar( minigun, var_mins, Float:{-2.0,-2.0,-2.0} );
set_entvar( minigun, var_maxs, Float:{5.0,5.0,5.0})
// entity_set_size(minigun,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
// entity_set_int(minigun,EV_INT_solid,1)
set_entvar( minigun, var_movetype, 6 );
set_entvar( minigun, var_iuser1, clipp[id]);
set_entvar( minigun, var_origin, origin );
// entity_set_int(minigun,EV_INT_movetype,6)
// entity_set_int(minigun, EV_INT_iuser1, clipp[id])
// entity_set_vector(minigun,EV_VEC_origin,origin)
has_minigun[id] = false
canfire[id] = false
remowegun(id)
g_plAction[id] = false
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public dropcmddir(id) {
if(has_minigun[id] && haswhpnnmg[id] && is_alive[id]) {
new Float:Aim[3],Float:origin[3]
velocity_by_aim(id, 64, Aim)
get_entvar( id, var_origin, origin );
origin[0] += Aim[0]
origin[1] += Aim[1]

new minigun = rg_create_entity("info_target")
set_entvar( minigun, var_classname, "minigun" );
//entity_set_string(minigun,EV_SZ_classname,"minigun")
engfunc( EngFunc_SetModel, minigun, W_MODEL );
//entity_set_model(minigun,W_MODEL)

set_entvar( minigun, var_solid, 1 );
set_entvar( minigun, var_mins, Float:{-2.0,-2.0,-2.0} );
set_entvar( minigun, var_maxs, Float:{5.0,5.0,5.0})
// entity_set_size(minigun,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
// entity_set_int(minigun,EV_INT_solid,1)
set_entvar( minigun, var_movetype, 6 );
set_entvar( minigun, var_iuser1, clipp[id]);
set_entvar( minigun, var_origin, origin );
// entity_set_int(minigun,EV_INT_movetype,6)
// entity_set_int(minigun, EV_INT_iuser1, clipp[id])
// entity_set_vector(minigun,EV_VEC_origin,origin)
has_minigun[id] = false
canfire[id] = false
remowegun(id)
g_plAction[id] = false
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public pfn_touch(ptr, ptd) {
if(!is_nullent(ptr)) {
new classname[32]
get_entvar( ptr, var_classname, classname, charsmax( classname ) );
//entity_get_string(ptr,EV_SZ_classname,classname,31)

if(equal(classname, "minigun")) {
if(!is_nullent(ptd)) {
new id = ptd
if(id > 0 && id < 34) {
if(!has_minigun[id] && is_alive[id] && !zp_get_user_zombie(id) && !user_has_weapon(id,CSW_M249)) {
give_weapon(id,get_entvar(ptr, var_iuser1), 0)
engfunc(EngFunc_RemoveEntity, ptr)
}
}
}
}
}
}

public remove_miniguns() {
new nextitem = rg_find_ent_by_class(-1,"minigun")
while(nextitem) {
engfunc(EngFunc_RemoveEntity, nextitem)
nextitem = rg_find_ent_by_class(-1,"minigun")
}
return PLUGIN_CONTINUE
}

//give wpn
public give_weapon(id, ammo, frst){
if( !has_minigun[ id ] && user_has_weapon( id, CSW_M249 ) )
{
//amxclient_cmd(id, "drop", "weapon_m249");
rg_drop_item( id, weapon_name );
}
has_minigun[id] = true
rg_give_item( id, weapon_name, GT_APPEND );
//give_item(id,"weapon_m249")
canfire[id] = true
clipp[id] = ammo
if(frst) frstCLIP[id] = true
else beackup[id] = true

}


//set models
public event_curweapon(id){
if(!is_alive[id] || !is_connected[id] || user_bot[id]) return;
new clip, ammo, weapon = get_user_weapon(id, clip, ammo)
if(zp_get_user_survivor(id) && get_pcvar_num(clipstartsuv)!=0 && !survivor[id]){
survivor[id] = true
give_weapon(id,0,1)
}
if((has_minigun[id]) && (weapon == CSW_M249)){
if(g_plAction[id] != act_run && frstCLIP[id]){
if(survivor[id]){
clipp[id] = get_pcvar_num(clipstartsuv)
} else {
clipp[id] = get_pcvar_num(clipstart)
}
//new ent = get_weapon_ent(id,weapon)
if(clipp[id] < get_pcvar_num(clipstart)) clipp[id] = get_pcvar_num(clipstart)
//cs_set_weapon_ammo(ent, clipp[id])
rg_set_user_ammo( id, WEAPON_M249, clipp[ id ] );
frstCLIP[id] = false
}
if(g_plAction[id] != act_run && beackup[id]){
//new ent = get_weapon_ent(id,weapon)
//cs_set_weapon_ammo(ent, clipp[id])
rg_set_user_ammo( id, WEAPON_M249, clipp[ id ] );
beackup[id] = false
}
if(clipp[id] == 0){
//new ent = get_weapon_ent(id,weapon)
//cs_set_weapon_ammo(ent, clipp[id])
rg_set_user_ammo( id, WEAPON_M249, clipp[ id ] );
}
if(g_plAction[id] == act_run){
clipp[id] = clip
}
message_begin(MSG_ONE, get_user_msgid("CurWeapon"), {0,0,0}, id)
write_byte(1)
write_byte(CSW_KNIFE)
write_byte(0)
message_end()
if(!haswhpnnmg[id]){
set_entvar( id, var_viewmodel ,V_MODEL );
set_entvar( id, var_weaponmodel, P_MODEL );

haswhpnnmg[id] = true
}
new Ent = get_weapon_ent(id,weapon)
new Float:N_Speed
if(Ent)
{
N_Speed = get_pcvar_float(m249)
new Float:Delay = get_member( Ent, m_Weapon_flNextPrimaryAttack ) * N_Speed;
//new Float:Delay = get_pdata_float( Ent, 46, 4) * N_Speed
if (Delay > 0.0){
set_member( Ent, m_Weapon_flNextPrimaryAttack, Delay );
//set_pdata_float( Ent, 46, Delay, 4)
}
}
ammo_hud(id)
if(atk1[id]){
fire_mode(id, 0)
}
if(atk2[id]){
fire_mode(id, 1)
}
}
if(weapon != CSW_M249) haswhpnnmg[id] = false
if((has_minigun[id]) && (!haswhpnnmg[id])) g_plAction[id] = act_none

return;
}

//play anim
public native_playanim(player,anim)
{
rg_set_animation( player, any:anim );
/*set_pev(player, pev_weaponanim, anim)
message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player)
write_byte(anim)
write_byte(pev(player, pev_body))
message_end()*/
}


//marks on hit
public native_gi_get_gunshot_decal()
{
return GUNSHOT_DECALS[random_num(0, sizeof(GUNSHOT_DECALS) - 1)]
}

//hit bulet
public testbulet(id){
// Find target
new aimOrigin[3], target, body
get_user_origin(id, aimOrigin, 3)
get_user_aiming(id, target, body)

if(target > 0 && target <= g_MaxPlayers)
{
new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
pev(id, pev_origin, fStart)

// Get ids view direction
velocity_by_aim(id, MAX_BLOOD_DISTANCE, fVel)

// Calculate position where blood should be displayed
fStart[0] = float(aimOrigin[0])
fStart[1] = float(aimOrigin[1])
fStart[2] = float(aimOrigin[2])
fEnd[0] = fStart[0]+fVel[0]
fEnd[1] = fStart[1]+fVel[1]
fEnd[2] = fStart[2]+fVel[2]

// Draw traceline from victims origin into ids view direction to find
// the location on the wall to put some blood on there
new res
engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
get_tr2(res, TR_vecEndPos, fRes)

// Show some blood :)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(floatround(fStart[0]))
write_coord(floatround(fStart[1]))
write_coord(floatround(fStart[2]))
write_short(g_bloodspray)
write_short(g_blood)
write_byte(70)
write_byte(random_num(1,2))
message_end()


} else {
new decal = native_gi_get_gunshot_decal()

// Check if the wall hit is an entity
if(target)
{
// Put decal on an entity
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_byte(decal)
write_short(target)
message_end()
} else {
// Put decal on "world" (a wall)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_byte(decal)
message_end()
}

// Show sparcles
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_short(id)
write_byte(decal)
message_end()
}
}




//block anim standart wpn
public UpdateClientData_Post( id, sendweapons, cd_handle ){
if ( !is_alive[id] ) return FMRES_IGNORED;
if(haswhpnnmg[id] && has_minigun[id]) set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001 );
return FMRES_HANDLED;
}

public fwd_CmdStart(id, uc_handle, seed)
{

if(!is_alive[id] || !has_minigun[id]) return FMRES_IGNORED
if(!canfire[id]) return FMRES_HANDLED

if(haswhpnnmg[id])
{
static buttons
buttons = get_uc(uc_handle, UC_Buttons)
if(buttons & IN_ATTACK)
{
atk1[id] = true
atk2[id] = false


}
else if(buttons & IN_ATTACK2)
{
atk2[id] = true
atk1[id] = false
}
if(atk1[id] && !atk2[id] && (g_plAction[id] == act_none || g_plAction[id] == act_load_up) && clipp[id]>0){
buttons &= ~IN_ATTACK
buttons &= ~IN_ATTACK2
set_uc(uc_handle, UC_Buttons, buttons)
fire_mode(id,0)
} else if(atk2[id] || atk1[id] && clipp[id]==0){
fire_mode(id,1)
}

}
return FMRES_IGNORED
}

// in fire
fire_mode(id, type) {
static Float:gtime
gtime = get_gametime()
g_lastShot[id] = gtime

if(g_nextSound[id] <= gtime && canfire[id]) {
switch(g_plAction[id]) {
case act_none: {
native_playanim(id, anim_spinup)
emit_sound(id, CHAN_WEAPON, m_SOUND[2], 1.0, ATTN_NORM, 0, PITCH_NORM)
g_nextSound[id] = gtime + LOADUP_TIME
g_plAction[id] = act_load_up
}
case act_load_up: {
g_nextSound[id] = gtime
g_plAction[id] = act_run
}
}
}

if(g_plAction[id] == act_run) {
if(type == 0 && clipp[id]>0 && atk1[id]){
emit_sound(id, CHAN_WEAPON, m_SOUND[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
testbulet(id)
if(!delay[id]) {
native_playanim(id, anim_spinfire)
ammo_hud(id)
set_task(0.2,"delayanim",id)
delay[id] = true
}
}
else {
if(!delay[id]) {
ammo_hud(id)
emit_sound(id, CHAN_WEAPON, m_SOUND[1], 1.0, ATTN_NORM, 0, PITCH_NORM)
native_playanim(id, anim_spinidle)
set_task(0.2,"delayanim",id)
delay[id] = true
}
}
}
atk1[id] = false
atk2[id] = false
}

public delayanim(id){
delay[id] = false
}

//sound and anim
public fwd_StartFrame() {
static Float:gtime, id

gtime = get_gametime()

for(id = 0; id <= g_MaxPlayers; id++) {
if(g_plAction[id] != act_none) {

if(!(pev(id, pev_button) & IN_ATTACK) && !(pev(id, pev_button) & IN_ATTACK2) && g_lastShot[id] + 0.2 < gtime) {
native_playanim(id, anim_spinidledown)
emit_sound(id, CHAN_WEAPON, m_SOUND[3], 1.0, ATTN_NORM, 0, PITCH_NORM)
g_nextSound[id] = gtime + SHUTDOWN_TIME
g_plAction[id] = act_none
}
}
}
}


// No recoil stuff

public fwPrecacheEvent(type, const name[]) {
for (new i = 0; i < sizeof g_guns_events; ++i) {
if (equal(g_guns_events[i], name)) {
g_guns_eventids_bitsum |= (1<<get_orig_retval())
return FMRES_HANDLED
}
}

return FMRES_IGNORED
}
public fwPlaybackEvent(flags, invoker, eventid) {
if (!(g_guns_eventids_bitsum & (1<<eventid)) || !(1 <= invoker <= g_MaxPlayers) || !haswhpnnmg[invoker] || !has_minigun[invoker])
return FMRES_IGNORED

g_fix_punchangle[invoker] = true

return FMRES_HANDLED
}

public fwPlayerPostThink(id) {
if (g_fix_punchangle[id]) {
g_fix_punchangle[id] = false
set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0})
return FMRES_HANDLED
}

return FMRES_IGNORED
}

public fwTraceLine(const Float:start[3], const Float:dest[3], ignore_monsters, id, ptr) {
if (!(1 <= id <= g_MaxPlayers))
return FMRES_IGNORED

if (!g_normal_trace[id]) {
g_normal_trace[id] = ptr
return FMRES_HANDLED
}
if (ptr == g_normal_trace[id] || ignore_monsters != DONT_IGNORE_MONSTERS || !is_alive[id] || !haswhpnnmg[id] || !has_minigun[id])
return FMRES_IGNORED

fix_recoil_trace(id, start, ptr)

return FMRES_SUPERCEDE
}

// show ammo clip
public ammo_hud(id) {
if(!delayhud[id]) {
delayhud[id] = true
new AmmoHud[65]
new clip = clipp[id]
format(AmmoHud, 64, "Ammo: %i", clip)
set_hudmessage(200, 100, 0, 1.0 , 1.0, 0, 0.1, 0.1,0.1)
show_hudmessage(id,"%s",AmmoHud)
set_task(0.2,"delayhutmsg",id)
}
}

public delayhutmsg(id){
delayhud[id]= false
}

//get weapon id
stock get_weapon_ent(id,wpnid=0,wpnName[]="")
{
// who knows what wpnName will be
static newName[24];

// need to find the name
if(wpnid) get_weaponname(wpnid,newName,23);

// go with what we were told
else formatex(newName,23,"%s",wpnName);

// prefix it if we need to
if(!equal(newName,"weapon_",7))
format(newName,23,"weapon_%s",newName);

return cs_find_ent_by_owner( get_maxplayers(), newName, id );
}
fix_recoil_trace(id, const Float:start[], ptr) {
static Float:dest[3]
pev(id, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
}
server crash debug.log sent above.

Plugin crash on ReHLDS, but if HLDS it doesn't crash.

Thanks!
 
Последнее редактирование модератором:
Сообщения
839
Реакции
519
Помог
12 раз(а)
Seems like not this plugin cause crash
More like a bad model somewhere

Code is worst btw
 

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

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