- Ошибка
-
SZ_GetSpace: overflow on ник игрока
- ОС
- 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 22:52:28
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a8
Build ID: 5294:363871a8
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:37:36 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
- ReGamedll
-
ReGameDLL version: 5.22.0.593-dev
Build date: 03:10:24 Jul 11 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/e1d1c11
- Версия Metamod
-
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:28 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5294 ini Start ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] YaPB RUN - yapb.dll v4.3.734 ini Chlvl ANY
[ 4] FakeMeta RUN - fakemeta_amxx.dll v1.8.3-dev+5154 pl1 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.8.3-dev+5154 pl1 ANY ANY
[ 6] CStrike RUN - cstrike_amxx.dll v1.8.3-dev+5154 pl1 ANY ANY
[ 7] Ham Sandwich RUN - hamsandwich_amxx.dll v1.8.3-dev+5154 pl1 ANY ANY
[ 8] Fun RUN - fun_amxx.dll v1.8.3-dev+5154 pl1 ANY ANY
[ 9] ReAPI RUN - reapi_amxx.dll v5.22.0.254-dev pl1 ANY Never
- Список плагинов
-
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] Teleport Menu 1.9.0.5294 AMXX Dev Team telemenu.amxx running
[ 10] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 11] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 12] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 13] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 14] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 15] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 16] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 17] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 18] unknown unknown unknown amxx_block_fith running
[ 19] [ZMO] Anti 512 Limit Best KOBRA amxx_unprecache running
[ 20] Block Buying (special) 0.1 Safety1st amxx_block_buyi running
[ 21] Lite MapChooser 2.6 neygomon amxx_lite_mapch running
[ 22] Remove Map Weapons 0.1 Safety1st amxx_remove_map running
[ 23] Precache Management 1.0.0 ConnorMcLeod amxx_precache_m stopped
[ 24] Zombie Plague 4.3 Fix MeRcyLeZZ zombie_plague40 running
[ 25] unknown unknown unknown zp_class_reviva running
[ 26] unknown unknown unknown zp_class_psycho running
[ 27] unknown unknown unknown zp_class_venom. running
[ 28] unknown unknown unknown zp_class_voodoo running
[ 29] [ZP] Sub Plugin: Ultim 1.1 93()|29!/<, Rand zp_addon_ammo_b running
[ 30] Zp Addon: New Score 1.5 kiryxapro zp_addon_score. running
[ 31] [ZP] Countdown 1.7.3 TalRasha zp_addon_countd running
[ 32] unknown unknown unknown zp_addon_efdrop running
[ 33] [ZP] Addon Killed Effe 1.0 PaXaN-ZOMBIE zp_addon_kill_e running
[ 34] unknown unknown unknown zp_addon_menu_h running
[ 35] unknown unknown unknown zp_addon_menu_v running
[ 36] [AMXX] Addon: Floating 1.0.6 Yoshioka Haruki zp_addon_floati running
[ 37] Bot not attack when ro 0.1 Dolph_ziggler zp_addon_bot_no running
[ 38] [ZP] Extra: CSO Strong 1.0 KORD_12.7 zp_weapon_stron running
[ 39] [ZP] Extra: CSO Fnp45 1.0 KORD_12.7 zp_weapon_fnp45 running
[ 40] [ZP] Extra: CSO Desert 1.0 KORD_12.7 zp_weapon_deagl running
[ 41] [ZP] Extra: CSO M3 1.0 KORD_12.7 zp_weapon_m3.am running
[ 42] [ZP] Extra: CSO AK47 1.0 KORD_12.7 zp_weapon_ak47. running
[ 43] [ZP] Extra: CSO M4A1 1.0 KORD_12.7 zp_weapon_m4a1. running
[ 44] [ZP] Extra: CSO AK47 L 1.0 KORD_12.7 zp_weapon_ak47l running
[ 45] [ZP] Extra: CSO Dual M 1.0 KORD_12.7 zp_weapon_dmp7a running
[ 46] [ZP] Extra: CSO Quad B 1.0 KORD_12.7 zp_weapon_qbarr running
[ 47] [ZP] Extra: CSO Dual K 1.0 KORD_12.7 zp_weapon_dkris running
[ 48] [ZP] Extra: CSO Buff M 1.0 KORD_12.7 zp_weapon_buffm running
[ 49] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_weapon_buffa running
[ 50] [ZP] Extra: CSO Weapon 1.1 TemplateAuthor:K zp_weapon_buffl running
[ 51] unknown unknown unknown zp_extra_armor. running
[ 52] [ZP] Extra: CSO M950 S 1.0 KORD_12.7 zp_extra_m950se running
[ 53] [ZP] Extra: CSO Spas12 1.0 KORD_12.7 zp_extra_spas12 running
[ 54] [ZP] Extra: CSO Bounce 1.0 KORD_12.7 zp_extra_bounce running
[ 55] [ZP] Extra: CSO Weapon 1.0 TemplateAuthor:K zp_extra_lglz1. running
[ 56] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_extra_hk121e running
[ 57] [ZP] Extra: CSO M134 P 1.0 KORD_12.7 zp_extra_m134ex running
[ 58] [ZP] Extra: CSO FG Lau 1.0 KORD_12.7 zp_extra_fglaun running
[ 59] unknown unknown unknown zp_zextra_jump_ running
59 plugins, 58 running
- Автор плагина
- KORD_12.7
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN "[ZP] Extra: CSO M950 SE"
#define VERSION "1.0"
#define AUTHOR "KORD_12.7"
#pragma ctrlchar '\'
//**********************************************
//* Weapon Settings. *
//**********************************************
// Main
#define WEAPON_KEY 4099
#define WEAPON_NAME "weapon_m950se_mpzs"
#define WEAPON_REFERANCE "weapon_p228"
#define WEAPON_MAX_CLIP 58
#define WEAPON_DEFAULT_AMMO 116
#define WEAPON_TIME_NEXT_IDLE 1.65
#define WEAPON_TIME_NEXT_ATTACK 0.2
#define WEAPON_TIME_DELAY_DEPLOY 1.3
#define WEAPON_TIME_DELAY_RELOAD 3.85
#define WEAPON_MULTIPLIER_DAMAGE 1.7
#define ZP_ITEM_NAME "M950 SE"
#define ZP_ITEM_COST 10
// Models
#define MODEL_WORLD "models/mpzs/wpn/w_m950se.mdl"
#define MODEL_VIEW "models/mpzs/wpn/v_m950se.mdl"
#define MODEL_PLAYER "models/mpzs/wpn/p_m950se.mdl"
#define MODEL_SHELL "models/rshell.mdl"
// Sounds
#define SOUND_FIRE "mpzs/wpn/m950se-1.wav"
// Sprites
#define WEAPON_HUD_TXT "sprites/weapon_m950se_mpzs.txt"
#define WEAPON_HUD_SPR_1 "sprites/mpzs/640hud142.spr"
#define WEAPON_HUD_SPR_2 "sprites/mpzs/640hud7.spr"
// Animation
#define ANIM_EXTENSION "carbine"
// Animation sequences
enum
{
ANIM_IDLE,
ANIM_RELOAD,
ANIM_DRAW,
ANIM_SHOOT1,
ANIM_SHOOT2,
ANIM_SHOOT3
};
//**********************************************
//* Some macroses. *
//**********************************************
#define MDLL_Spawn(%0) dllfunc(DLLFunc_Spawn, %0)
#define MDLL_Touch(%0,%1) dllfunc(DLLFunc_Touch, %0, %1)
#define MDLL_USE(%0,%1) dllfunc(DLLFunc_Use, %0, %1)
#define SET_MODEL(%0,%1) engfunc(EngFunc_SetModel, %0, %1)
#define SET_ORIGIN(%0,%1) engfunc(EngFunc_SetOrigin, %0, %1)
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define PRECACHE_SOUND(%0) engfunc(EngFunc_PrecacheSound, %0)
#define PRECACHE_GENERIC(%0) engfunc(EngFunc_PrecacheGeneric, %0)
#define MESSAGE_BEGIN(%0,%1,%2,%3) engfunc(EngFunc_MessageBegin, %0, %1, %2, %3)
#define MESSAGE_END() message_end()
#define WRITE_ANGLE(%0) engfunc(EngFunc_WriteAngle, %0)
#define WRITE_BYTE(%0) write_byte(%0)
#define WRITE_COORD(%0) engfunc(EngFunc_WriteCoord, %0)
#define WRITE_STRING(%0) write_string(%0)
#define WRITE_SHORT(%0) write_short(%0)
#define BitSet(%0,%1) (%0 |= (1 << (%1 - 1)))
#define BitClear(%0,%1) (%0 &= ~(1 << (%1 - 1)))
#define BitCheck(%0,%1) (%0 & (1 << (%1 - 1)))
#define INSTANCE(%0) ((%0 == -1) ? 0 : %0)
//**********************************************
//* PvData Offsets. *
//**********************************************
// Linux extra offsets
#define extra_offset_weapon 4
#define extra_offset_player 5
new g_bitIsConnected;
#define m_rgpPlayerItems_CWeaponBox 34
// CBasePlayerItem
#define m_pPlayer 41
#define m_pNext 42
#define m_iId 43
// CBasePlayerWeapon
#define m_flNextPrimaryAttack 46
#define m_flNextSecondaryAttack 47
#define m_flTimeWeaponIdle 48
#define m_iPrimaryAmmoType 49
#define m_iClip 51
#define m_fInReload 54
#define m_flAccuracy 62
#define m_iShotsFired 64
#define m_iLastZoom 109
// CBaseMonster
#define m_flNextAttack 83
// CBasePlayer
#define m_fResumeZoom 110
#define m_iFOV 363
#define m_rgpPlayerItems_CBasePlayer 367
#define m_pActiveItem 373
#define m_rgAmmo_CBasePlayer 376
#define m_szAnimExtention 492
#define IsValidPev(%0) (pev_valid(%0) == 2)
//**********************************************
//* Let's code our weapon. *
//**********************************************
new iShellModelIndex
Weapon_OnPrecache()
{
PRECACHE_SOUND_FROM_MODEL(MODEL_VIEW);
PRECACHE_MODEL(MODEL_WORLD);
PRECACHE_MODEL(MODEL_VIEW);
PRECACHE_MODEL(MODEL_PLAYER);
iShellModelIndex = PRECACHE_MODEL(MODEL_SHELL);
PRECACHE_SOUND(SOUND_FIRE);
PRECACHE_GENERIC(WEAPON_HUD_TXT);
PRECACHE_GENERIC(WEAPON_HUD_SPR_1);
PRECACHE_GENERIC(WEAPON_HUD_SPR_2);
}
Weapon_OnSpawn(const iItem)
{
// Setting world model.
SET_MODEL(iItem, MODEL_WORLD);
}
Weapon_OnDeploy(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
#pragma unused iClip, iAmmoPrimary
static iszViewModel;
if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, MODEL_VIEW)))
{
set_pev_string(iPlayer, pev_viewmodel2, iszViewModel);
}
static iszPlayerModel;
if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, MODEL_PLAYER)))
{
set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel);
}
// Cancel any reload in progress.
set_pdata_int(iItem, m_fInReload, 0, extra_offset_weapon);
set_pdata_string(iPlayer, m_szAnimExtention * 4, ANIM_EXTENSION, -1, extra_offset_player * 4);
set_pdata_float(iItem, m_flTimeWeaponIdle, WEAPON_TIME_DELAY_DEPLOY, extra_offset_weapon);
set_pdata_float(iPlayer, m_flNextAttack, WEAPON_TIME_DELAY_DEPLOY, extra_offset_player);
// Deploy with default weapon settings
Weapon_DefaultDeploy(iPlayer, MODEL_VIEW, MODEL_PLAYER, ANIM_DRAW, ANIM_EXTENSION);
}
Weapon_OnHolster(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
#pragma unused iPlayer, iClip, iAmmoPrimary
// Cancel any reload in progress.
set_pdata_int(iItem, m_fInReload, 0, extra_offset_weapon);
}
Weapon_OnIdle(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
#pragma unused iClip, iAmmoPrimary
ExecuteHamB(Ham_Weapon_ResetEmptySound, iItem);
if (get_pdata_float(iItem, m_flTimeWeaponIdle, extra_offset_weapon) > 0.0)
{
return;
}
set_pdata_float(iItem, m_flTimeWeaponIdle, WEAPON_TIME_NEXT_IDLE, extra_offset_weapon);
Weapon_SendAnim(iPlayer, ANIM_IDLE);
}
Weapon_OnReload(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
if (min(WEAPON_MAX_CLIP - iClip, iAmmoPrimary) <= 0)
{
return;
}
set_pdata_int(iItem, m_iClip, 0, extra_offset_weapon);
ExecuteHam(Ham_Weapon_Reload, iItem);
set_pdata_int(iPlayer, m_iFOV, 90, extra_offset_player);
set_pdata_int(iItem, m_iClip, iClip, extra_offset_weapon);
set_pdata_float(iPlayer, m_flNextAttack, WEAPON_TIME_DELAY_RELOAD, extra_offset_player);
set_pdata_float(iItem, m_flTimeWeaponIdle, WEAPON_TIME_DELAY_RELOAD, extra_offset_weapon);
Weapon_SendAnim(iPlayer, ANIM_RELOAD);
}
Weapon_OnPrimaryAttack(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
#pragma unused iAmmoPrimary
if (get_pdata_float(iItem, m_flNextPrimaryAttack, extra_offset_weapon) > 0.0)
{
return;
}
CallOrigFireBullets3(iItem, iPlayer)
if (iClip <= 0)
{
return;
}
static iFlags, iAnimDesired;
static szAnimation[64];iFlags = pev(iPlayer, pev_flags);
emit_sound(iPlayer, CHAN_WEAPON, SOUND_FIRE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
Weapon_SendAnim(iPlayer, random_num(ANIM_SHOOT1, ANIM_SHOOT2));
formatex(szAnimation, charsmax(szAnimation), iFlags & FL_DUCKING ? "crouch_shoot_%s" : "ref_shoot_%s", ANIM_EXTENSION);
if ((iAnimDesired = lookup_sequence(iPlayer, szAnimation)) == -1)
{
iAnimDesired = 0;
}
set_pev(iPlayer, pev_sequence, iAnimDesired);
PunchAxis(iPlayer, -1.0, 0.3)
set_pdata_float(iItem, m_flAccuracy, 0.75 ,extra_offset_weapon)
set_pdata_float(iItem, m_flNextPrimaryAttack, WEAPON_TIME_NEXT_ATTACK, extra_offset_weapon);
set_pdata_float(iItem, m_flTimeWeaponIdle, WEAPON_TIME_NEXT_ATTACK+1.7, extra_offset_weapon);
set_pdata_int(iItem, m_iClip, iClip-1, extra_offset_weapon);
set_pdata_int(iItem, m_iShotsFired, 0, extra_offset_weapon);
UTIL_EjectBrass(iItem, iPlayer, iShellModelIndex)
}
Weapon_OnSecondaryAttack(const iItem, const iPlayer, const iClip, const iAmmoPrimary)
{
#pragma unused iClip, iAmmoPrimary
set_pdata_float(iItem, m_flNextSecondaryAttack, 0.3, extra_offset_weapon);
set_pdata_int(iPlayer, m_iFOV, get_pdata_int(iPlayer, m_iFOV, extra_offset_player) == 90 ? 65 : 90, extra_offset_player);
}
//*********************************************************************
//* Don't modify the code below this line unless *
//* you know _exactly_ what you are doing!!! *
//*********************************************************************
#define MSGID_WEAPONLIST 78
new g_iItemID;
#define IsCustomItem(%0) (pev(%0, pev_impulse) == WEAPON_KEY)
public plugin_precache()
{
Weapon_OnPrecache();
register_clcmd(WEAPON_NAME, "Cmd_WeaponSelect");
register_message(MSGID_WEAPONLIST, "MsgHook_WeaponList");
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_PlaybackEvent, "FakeMeta_PlaybackEvent", false);
register_forward(FM_SetModel, "FakeMeta_SetModel", false);
register_forward(FM_UpdateClientData, "FakeMeta_UpdateClientData_Post",true);
// Weaponbox
RegisterHam(Ham_Spawn, "weaponbox", "HamHook_Weaponbox_Spawn_Post", true);
// Hook and change damage to entities
RegisterHam(Ham_TraceAttack, "func_breakable", "HamHook_Entity_TraceAttack", false);
RegisterHam(Ham_TraceAttack, "info_target", "HamHook_Entity_TraceAttack", false);
RegisterHam(Ham_TraceAttack, "player", "HamHook_Entity_TraceAttack", false);
// Item (weapon) hooks
RegisterHam(Ham_Item_Deploy, WEAPON_REFERANCE, "HamHook_Item_Deploy_Post", true);
RegisterHam(Ham_Item_Holster, WEAPON_REFERANCE, "HamHook_Item_Holster", false);
RegisterHam(Ham_Item_AddToPlayer, WEAPON_REFERANCE, "HamHook_Item_AddToPlayer", false);
RegisterHam(Ham_Item_PostFrame, WEAPON_REFERANCE, "HamHook_Item_PostFrame", false);
RegisterHam(Ham_Weapon_Reload, WEAPON_REFERANCE, "HamHook_Item_Reload", false);
RegisterHam(Ham_Weapon_WeaponIdle, WEAPON_REFERANCE, "HamHook_Item_WeaponIdle", false);
RegisterHam(Ham_Weapon_PrimaryAttack, WEAPON_REFERANCE, "HamHook_Item_PrimaryAttack", false);
g_iItemID = zp_register_extra_item(ZP_ITEM_NAME, ZP_ITEM_COST, ZP_TEAM_HUMAN);
}
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_iItemID)
{
Weapon_Give(id);
}
}
public plugin_natives()
{
register_native("GetM950SE", "NativeGiveWeapon", true);
register_native("CheckItemM950SE", "CheckItem2", true);
}
public NativeGiveWeapon(iPlayer)
{
Weapon_Give(iPlayer);
}
public CheckItem2(iItem, iPlayer)
{
if (!CheckItem(iItem, iPlayer))
{
return 0;
}
return 1;
}
//**********************************************
//* Block client weapon. *
//**********************************************
public FakeMeta_UpdateClientData_Post(const iPlayer, const iSendWeapons, const CD_Handle)
{
static iActiveItem;iActiveItem = get_pdata_cbase(iPlayer, m_pActiveItem, extra_offset_player);
if (!IsValidPev(iActiveItem) || !IsCustomItem(iActiveItem))
{
return FMRES_IGNORED;
}
set_cd(CD_Handle, CD_flNextAttack, get_gametime() + 0.001);
return FMRES_IGNORED;
}
//**********************************************
//* Item (weapon) hooks. *
//**********************************************
#define _call.%0(%1,%2) \
\
Weapon_On%0 \
( \
%1, \
%2, \
\
get_pdata_int(%1, m_iClip, extra_offset_weapon), \
\
GetAmmoInventory(%2, PrimaryAmmoIndex(%1)) \
)
public HamHook_Item_Deploy_Post(const iItem)
{
new iPlayer;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
_call.Deploy(iItem, iPlayer);
return HAM_IGNORED;
}
public HamHook_Item_Holster(const iItem)
{
new iPlayer;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
set_pev(iPlayer, pev_viewmodel, 0);
set_pev(iPlayer, pev_weaponmodel, 0);
_call.Holster(iItem, iPlayer);
return HAM_SUPERCEDE;
}
public HamHook_Item_WeaponIdle(const iItem)
{
static iPlayer;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
_call.Idle(iItem, iPlayer);
return HAM_SUPERCEDE;
}
public HamHook_Item_Reload(const iItem)
{
static iPlayer;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
_call.Reload(iItem, iPlayer);
return HAM_SUPERCEDE;
}
public HamHook_Item_PrimaryAttack(const iItem)
{
static iPlayer;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
_call.PrimaryAttack(iItem, iPlayer);
return HAM_SUPERCEDE;
}
public HamHook_Item_PostFrame(const iItem)
{
static iPlayer;
static iButton;
if (!CheckItem(iItem, iPlayer))
{
return HAM_IGNORED;
}
// Complete reload
if (get_pdata_int(iItem, m_fInReload, extra_offset_weapon))
{
new iClip = get_pdata_int(iItem, m_iClip, extra_offset_weapon);
new iPrimaryAmmoIndex = PrimaryAmmoIndex(iItem);
new iAmmoPrimary = GetAmmoInventory(iPlayer, iPrimaryAmmoIndex);
new iAmount = min(WEAPON_MAX_CLIP - iClip, iAmmoPrimary);
set_pdata_int(iItem, m_iClip, iClip + iAmount, extra_offset_weapon);
set_pdata_int(iItem, m_fInReload, false, extra_offset_weapon);
//SetAmmoInventory(iPlayer, iPrimaryAmmoIndex, iAmmoPrimary - iAmount);
}
// Call secondary attack
if ((iButton = pev(iPlayer, pev_button)) & IN_ATTACK2
&& get_pdata_float(iItem, m_flNextSecondaryAttack, extra_offset_weapon) <= 0.0)
{
_call.SecondaryAttack(iItem, iPlayer);
set_pev(iPlayer, pev_button, iButton & ~IN_ATTACK2);
}
return HAM_IGNORED;
}
//**********************************************
//* Fire Bullets. *
//**********************************************
CallOrigFireBullets3(const iItem, const iPlayer)
{
static fm_hooktrace;fm_hooktrace=register_forward(FM_TraceLine,"FakeMeta_TraceLine",true)
state FireBullets: Enabled;
static Float: vecPuncheAngle[3];
pev(iPlayer, pev_punchangle, vecPuncheAngle);
ExecuteHam(Ham_Weapon_PrimaryAttack, iItem);
set_pev(iPlayer, pev_punchangle, vecPuncheAngle);
state FireBullets: Disabled;
unregister_forward(FM_TraceLine,fm_hooktrace,true)
}
public FakeMeta_PlaybackEvent() <FireBullets: Enabled>
{
return FMRES_SUPERCEDE;
}
public FakeMeta_TraceLine(Float:Tr_Start[3], Float:Tr_End[3], Tr_Flag, Tr_Ignore, iTrase)
{
if(Tr_Flag&IGNORE_MONSTERS)
{
return FMRES_IGNORED;
}
static Float:vecEnd[3];
static iHit;
static Decal;
static glassdecal;
if(!glassdecal)
{
glassdecal=engfunc( EngFunc_DecalIndex, "{bproof1" )
}
iHit=get_tr2(iTrase,TR_pHit)
if(iHit>0 && pev_valid(iHit))
if(pev(iHit,pev_solid)!=SOLID_BSP)return FMRES_IGNORED
else if(pev(iHit,pev_rendermode)!=0)Decal=glassdecal
else Decal=random_num(41,45)
else Decal=random_num(41,45)
get_tr2(iTrase, TR_vecEndPos, vecEnd)
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, vecEnd, 0)
write_byte(TE_GUNSHOTDECAL)
WRITE_COORD(vecEnd[0])
WRITE_COORD(vecEnd[1])
WRITE_COORD(vecEnd[2])
write_short(iHit > 0 ? iHit : 0)
write_byte(Decal)
message_end()
return FMRES_IGNORED
}
public HamHook_Entity_TraceAttack(const iEntity, const iAttacker, const Float: flDamage) <FireBullets: Enabled>
{
static iActiveItem;
if (!BitCheck(g_bitIsConnected, iAttacker) || !IsValidPev(iAttacker))
{
return;
}
iActiveItem = get_pdata_cbase(iAttacker, m_pActiveItem, extra_offset_player);
if (!IsValidPev(iActiveItem))
{
return;
}
SetHamParamFloat(3, flDamage * WEAPON_MULTIPLIER_DAMAGE);
}
public MsgHook_Death() </* Empty statement */> { /* Fallback */ }
public MsgHook_Death() <FireBullets: Disabled> { /* Do notning */ }
public FakeMeta_PlaybackEvent() </* Empty statement */> { return FMRES_IGNORED; }
public FakeMeta_PlaybackEvent() <FireBullets: Disabled> { return FMRES_IGNORED; }
public HamHook_Entity_TraceAttack() </* Empty statement */> { /* Fallback */ }
public HamHook_Entity_TraceAttack() <FireBullets: Disabled> { /* Do notning */ }
Weapon_Create(const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0})
{
new iWeapon;
static iszAllocStringCached;
if (iszAllocStringCached || (iszAllocStringCached = engfunc(EngFunc_AllocString, WEAPON_REFERANCE)))
{
iWeapon = engfunc(EngFunc_CreateNamedEntity, iszAllocStringCached);
}
if (!IsValidPev(iWeapon))
{
return FM_NULLENT;
}
MDLL_Spawn(iWeapon);
SET_ORIGIN(iWeapon, vecOrigin);
set_pdata_int(iWeapon, m_iClip, WEAPON_MAX_CLIP, extra_offset_weapon);
set_pev(iWeapon, pev_impulse, WEAPON_KEY);
set_pev(iWeapon, pev_angles, vecAngles);
Weapon_OnSpawn(iWeapon);
return iWeapon;
}
Weapon_Give(const iPlayer)
{
if (!IsValidPev(iPlayer))
{
return FM_NULLENT;
}
new iWeapon, Float: vecOrigin[3];
pev(iPlayer, pev_origin, vecOrigin);
if ((iWeapon = Weapon_Create(vecOrigin)) != FM_NULLENT)
{
Player_DropWeapons(iPlayer, ExecuteHamB(Ham_Item_ItemSlot, iWeapon));
set_pev(iWeapon, pev_spawnflags, pev(iWeapon, pev_spawnflags) | SF_NORESPAWN);
MDLL_Touch(iWeapon, iPlayer);
SetAmmoInventory(iPlayer, PrimaryAmmoIndex(iWeapon), WEAPON_DEFAULT_AMMO);
return iWeapon;
}
return FM_NULLENT;
}
Player_DropWeapons(const iPlayer, const iSlot)
{
new szWeaponName[32], iItem = get_pdata_cbase(iPlayer, m_rgpPlayerItems_CBasePlayer + iSlot, extra_offset_player);
while (IsValidPev(iItem))
{
pev(iItem, pev_classname, szWeaponName, charsmax(szWeaponName));
engclient_cmd(iPlayer, "drop", szWeaponName);
iItem = get_pdata_cbase(iItem, m_pNext, extra_offset_weapon);
}
}
Weapon_SendAnim(const iPlayer, const iAnim)
{
set_pev(iPlayer, pev_weaponanim, iAnim);
MESSAGE_BEGIN(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0.0, 0.0, 0.0}, iPlayer);
WRITE_BYTE(iAnim);
WRITE_BYTE(0);
MESSAGE_END();
}
stock Weapon_DefaultDeploy(const iPlayer, const szViewModel[], const szWeaponModel[], const iAnim, const szAnimExt[])
{
set_pev(iPlayer, pev_viewmodel2, szViewModel);
set_pev(iPlayer, pev_weaponmodel2, szWeaponModel);
set_pev(iPlayer, pev_fov, 90.0);
set_pdata_int(iPlayer, m_iFOV, 90, extra_offset_player);
set_pdata_int(iPlayer, m_fResumeZoom, 0, extra_offset_player);
set_pdata_int(iPlayer, m_iLastZoom, 90, extra_offset_player);
set_pdata_string(iPlayer, m_szAnimExtention * 4, szAnimExt, -1, extra_offset_player * 4);
Weapon_SendAnim(iPlayer, iAnim);
}
stock PunchAxis(id, Float:x, Float:y, Float:x_min = -100.0, Float:y_min = -100.0)
{
new Float:vec[3];pev(id, pev_punchangle, vec);vec[0] += x;vec[1] += y;
vec[0] = vec[0] < x_min ? x_min : vec[0];vec[0] = vec[0] > -x_min ? -x_min : vec[0];
vec[1] = vec[1] < y_min ? y_min : vec[1];vec[1] = vec[1] > -y_min ? -y_min : vec[1];
set_pev(id, pev_punchangle, vec);
}
#define BitSet(%0,%1) (%0 |= (1 << (%1 - 1)))
#define BitClear(%0,%1) (%0 &= ~(1 << (%1 - 1)))
#define BitCheck(%0,%1) (%0 & (1 << (%1 - 1)))
public client_putinserver(id)
{
BitSet(g_bitIsConnected, id);
}
public client_disconnected(id)
{
BitClear(g_bitIsConnected, id);
}
bool: CheckItem(const iItem, &iPlayer)
{
if (!IsValidPev(iItem) || !IsCustomItem(iItem))
{
return false;
}
iPlayer = get_pdata_cbase(iItem, m_pPlayer, extra_offset_weapon);
if (!IsValidPev(iPlayer) || !BitCheck(g_bitIsConnected, iPlayer))
{
return false;
}
return true;
}
//**********************************************
//* Weapon list update. *
//**********************************************
public Cmd_WeaponSelect(const iPlayer)
{
engclient_cmd(iPlayer, WEAPON_REFERANCE);
return PLUGIN_HANDLED;
}
public HamHook_Item_AddToPlayer(const iItem, const iPlayer)
{
switch(pev(iItem, pev_impulse))
{
case 0: MsgHook_WeaponList(MSGID_WEAPONLIST, iItem, iPlayer);
case WEAPON_KEY:
{
MsgHook_WeaponList(MSGID_WEAPONLIST, iItem, iPlayer);
SetAmmoInventory(iPlayer, PrimaryAmmoIndex(iItem), pev(iItem, pev_iuser2));
}
}
return HAM_IGNORED;
}
public MsgHook_WeaponList(const iMsgID, const iMsgDest, const iMsgEntity)
{
static arrWeaponListData[8];
if (!iMsgEntity)
{
new szWeaponName[32];
get_msg_arg_string(1, szWeaponName, charsmax(szWeaponName));
if (!strcmp(szWeaponName, WEAPON_REFERANCE))
{
for (new i, a = sizeof arrWeaponListData; i < a; i++)
{
arrWeaponListData[i] = get_msg_arg_int(i + 2);
}
}
}
else
{
if (!IsCustomItem(iMsgDest) && pev(iMsgDest, pev_impulse))
{
return;
}
MESSAGE_BEGIN(MSG_ONE, iMsgID, {0.0, 0.0, 0.0}, iMsgEntity);
WRITE_STRING(IsCustomItem(iMsgDest) ? WEAPON_NAME : WEAPON_REFERANCE);
for (new i, a = sizeof arrWeaponListData; i < a; i++)
{
WRITE_BYTE(arrWeaponListData[i]);
}
MESSAGE_END();
}
}
//**********************************************
//* Weaponbox world model. *
//**********************************************
public HamHook_Weaponbox_Spawn_Post(const iWeaponBox)
{
if (IsValidPev(iWeaponBox))
{
state (IsValidPev(pev(iWeaponBox, pev_owner))) WeaponBox: Enabled;
}
return HAM_IGNORED;
}
public FakeMeta_SetModel(const iEntity) <WeaponBox: Enabled>
{
state WeaponBox: Disabled;
if (!IsValidPev(iEntity))
{
return FMRES_IGNORED;
}
#define MAX_ITEM_TYPES 6
for (new i, iItem; i < MAX_ITEM_TYPES; i++)
{
iItem = get_pdata_cbase(iEntity, m_rgpPlayerItems_CWeaponBox + i, extra_offset_weapon);
if (IsValidPev(iItem) && IsCustomItem(iItem))
{
SET_MODEL(iEntity, MODEL_WORLD);
set_pev(iItem, pev_iuser2, GetAmmoInventory(pev(iEntity,pev_owner), PrimaryAmmoIndex(iItem)))
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public FakeMeta_SetModel() </* Empty statement */> { /* Fallback */ return FMRES_IGNORED; }
public FakeMeta_SetModel() < WeaponBox: Disabled > { /* Do nothing */ return FMRES_IGNORED; }
//**********************************************
//* Ammo Inventory. *
//**********************************************
PrimaryAmmoIndex(const iItem)
{
return get_pdata_int(iItem, m_iPrimaryAmmoType, extra_offset_weapon);
}
GetAmmoInventory(const iPlayer, const iAmmoIndex)
{
if (iAmmoIndex == -1)
{
return -1;
}
return get_pdata_int(iPlayer, m_rgAmmo_CBasePlayer + iAmmoIndex, extra_offset_player);
}
SetAmmoInventory(const iPlayer, const iAmmoIndex, const iAmount)
{
if (iAmmoIndex == -1)
{
return 0;
}
set_pdata_int(iPlayer, m_rgAmmo_CBasePlayer + iAmmoIndex, iAmount, extra_offset_player);
return 1;
}
#define m_iShellId 57
#define m_flEjectBrass 111
stock UTIL_EjectBrass(iWeapon, iPlayer, g_iszModelIndexShell)
{
set_pdata_int(iWeapon, m_iShellId, g_iszModelIndexShell, 4);
set_pdata_float(iPlayer, m_flEjectBrass, get_gametime());
}
PRECACHE_SOUND_FROM_MODEL(const szModelPath[])
{
new iFile;
if ((iFile = fopen(szModelPath, "rt")))
{
new szSoundPath[64];
new iNumSeq, iSeqIndex;
new iEvent, iNumEvents, iEventIndex;
fseek(iFile, 164, SEEK_SET);
fread(iFile, iNumSeq, BLOCK_INT);
fread(iFile, iSeqIndex, BLOCK_INT);
for (new k, i = 0; i < iNumSeq; i++)
{
fseek(iFile, iSeqIndex + 48 + 176 * i, SEEK_SET);
fread(iFile, iNumEvents, BLOCK_INT);
fread(iFile, iEventIndex, BLOCK_INT);
fseek(iFile, iEventIndex + 176 * i, SEEK_SET);
for (k = 0; k < iNumEvents; k++)
{
fseek(iFile, iEventIndex + 4 + 76 * k, SEEK_SET);
fread(iFile, iEvent, BLOCK_INT);
fseek(iFile, 4, SEEK_CUR);
if (iEvent != 5004)
{
continue;
}
fread_blocks(iFile, szSoundPath, 64, BLOCK_CHAR);
if (strlen(szSoundPath))
{
strtolower(szSoundPath);
PRECACHE_SOUND(szSoundPath);
}
}
}
}
fclose(iFile);
}
После того как добавил этот плагин на сервер игрока с этим оружием стало выкидывать с сервера (крашит кс) и писать в консоли сервера SZ_GetSpace: overflow on ник игрока, помогите решить проблему.
В этой теме было размещено решение! Перейти к решению.