no animation when you are watching

Сообщения
5
Реакции
-1
Ошибка
no animation when you are watching
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5271
Билд
Build date: 10:28:07 Feb  8 2021 (2494)
ReGamedll
ReGameDLL version: 5.20.0.492-dev
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
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.135 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] Revoice RUN - revoice_mm.dll v0.1.0.34 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.5 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm.dll v1.5.697 ini Chlvl ANY
[ 9] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5 ANY ANY
[11] CSX RUN - csx_amxx.dll v1.9.0.5271 pl5 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5 ANY ANY
[13] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5 ANY Never
[14] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5 ANY ANY
[15] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5 ANY ANY
15 plugins, 15 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5271 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5271 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5271 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5271 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5271 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0.5271 AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5271 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 21] Restrict Weapons 1.9.0.5271 AMXX Dev Team restmenu.amxx running
[ 22] StatsX 1.9.0.5271 AMXX Dev Team statsx.amxx running
[ 23] CS Misc. Stats 1.9.0.5271 AMXX Dev Team miscstats.amxx running
[ 24] CS Stats Logging 1.9.0.5271 AMXX Dev Team stats_logging.a running
[ 25] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 26] CS:GO - Change sound w 1.0 EFFx csgo_change_sou running
26 plugins, 26 running
Автор плагина
EFFx
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <xs>

#define PLUGIN "CSGOM: Weapon sounds"
#define VERSION "1.0"
#define AUTHOR "EFFx"

#define TASK_PLAYSOUND 31321
#define m_pActiveItem 373
#define m_iId 43
#define m_pPlayer 41
#define RIGHT_PISTOL 8
#define LEFT_PISTOL 6
#define XTRA_OFS_PLAYER 5
#define XTRA_OFS_WEAPON 4

enum wWeaponData
{
szWeaponName[20],
szFireSound[64],
szDeploySound[64],
iFireAnimation
}

new const AllWeapons[][wWeaponData] =
{
{"", "", ""},
{"weapon_p228", "csgom/weapons/p228_fire.wav", "csgom/weapons/pistol_deploy.wav", 1},
{"", "", ""},
{"weapon_scout", "csgom/weapons/scout_fire.wav", "csgom/weapons/default_deploy.wav", 1},
{"", "", ""},
{"weapon_xm1014", "csgom/weapons/xm1014_fire.wav", "csgom/weapons/pistol_deploy.wav", 2},
{"", "", ""},
{"weapon_mac10", "csgom/weapons/mac10_fire.wav", "csgom/weapons/default_deploy.wav", 4},
{"weapon_aug", "csgom/weapons/aug_fire.wav", "csgom/weapons/default_deploy.wav", 3},
{"", "", ""},
{"weapon_elite", "csgom/weapons/elite_fire.wav", "csgom/weapons/pistol_deploy.wav", 7},
{"weapon_fiveseven", "csgom/weapons/fiveseven_fire.wav", "csgom/weapons/pistol_deploy.wav", 1},
{"weapon_ump45", "csgom/weapons/ump45_fire.wav", "csgom/weapons/default_deploy.wav", 4},
{"weapon_sg550", "csgom/weapons/sg550_fire.wav", "csgom/weapons/default_deploy.wav", 2},
{"weapon_galil", "csgom/weapons/galil_fire.wav", "csgom/weapons/default_deploy.wav", 3},
{"weapon_famas", "csgom/weapons/famas_fire.wav", "csgom/weapons/default_deploy.wav", 3},
{"weapon_usp", "csgom/weapons/usp_fire.wav", "csgom/weapons/pistol_deploy.wav", 9},
{"weapon_glock18", "csgom/weapons/glock18_fire.wav", "csgom/weapons/pistol_deploy.wav", 5},
{"weapon_awp", "csgom/weapons/awp_fire_new2.wav", "csgom/weapons/default_deploy.wav", 2},
{"weapon_mp5navy", "csgom/weapons/mp5_fire.wav", "csgom/weapons/default_deploy.wav", 5},
{"weapon_m249", "csgom/weapons/m249_fire.wav", "csgom/weapons/default_deploy.wav", 2},
{"weapon_m3", "csgom/weapons/m3_fire.wav", "csgom/weapons/shotgun_deploy.wav", 1},
{"weapon_m4a1", "csgom/weapons/m4a4_fire.wav", "csgom/weapons/default_deploy.wav", 8},
{"weapon_tmp", "csgom/weapons/tmp_fire.wav", "csgom/weapons/default_deploy.wav", 4},
{"weapon_g3sg1", "csgom/weapons/g3sg1_fire.wav", "csgom/weapons/default_deploy.wav", 2},
{"", "", ""},
{"weapon_deagle", "csgom/weapons/deagle_fire.wav", "csgom/weapons/pistol_deploy.wav", 2},
{"weapon_sg552", "csgom/weapons/sg552_fire.wav", "csgom/weapons/default_deploy.wav", 3},
{"weapon_ak47", "csgom/weapons/ak_fire.wav", "csgom/weapons/default_deploy.wav", 3},
{"", "", ""},
{"weapon_p90", "csgom/weapons/p90_fire.wav", "csgom/weapons/default_deploy.wav", 5}
}

new const g_szM4A4FireSoundNoSilencer[] = "csgom/weapons/m4a1_fire_nosilencer.wav"
new const g_szM4A4FireSoundSilencer[] = "csgom/weapons/m4a1_fire_silencer.wav"
new const g_szUSPFireSoundNoSilencer[] = "csgom/weapons/usp_fire.wav"
new const g_szUSPFireSoundSilencer[] = "csgom/weapons/usp_fire_silencer.wav"

new const g_szBurstSound[] = "csgom/weapons/burst.wav"

new g_iShellModel, g_iSmokeSprite
new g_iFireValue[MAX_PLAYERS + 1]

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack_World")
RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack_World")
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_m4a1", "CBaseWeapon_SecondaryAttack_Pre")
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_glock18", "CBaseWeapon_SecondaryAttack_Pre")

for(new i;i < sizeof AllWeapons;i++)
{
if(!AllWeapons[i][szWeaponName][0])
continue

RegisterHam(Ham_Item_Deploy, AllWeapons[i][szWeaponName], "ham_WeaponDeploy_Post", 1)
}

register_forward(FM_EmitSound, "EmitSound")
register_forward(FM_UpdateClientData, "Fw_UpdateClientData_Post", 1)
register_forward(FM_PlaybackEvent, "fw_PlaybackEvent")
}

public plugin_precache()
{
g_iShellModel = engfunc(EngFunc_PrecacheModel, "models/rshell.mdl")
g_iSmokeSprite = engfunc(EngFunc_PrecacheModel, "sprites/gunsmoke.spr")

for(new i;i < sizeof AllWeapons;i++)
{
if(!AllWeapons[i][szFireSound])
continue

engfunc(EngFunc_PrecacheSound, AllWeapons[i][szFireSound])
engfunc(EngFunc_PrecacheSound, AllWeapons[i][szDeploySound])
}

precache_sound(g_szUSPFireSoundNoSilencer)
precache_sound(g_szUSPFireSoundSilencer)
precache_sound(g_szM4A4FireSoundNoSilencer)
precache_sound(g_szM4A4FireSoundSilencer)

precache_sound(g_szBurstSound)
}

public CBaseWeapon_SecondaryAttack_Pre(const iWeapon)
{
static id; id = get_pdata_cbase(iWeapon, m_pPlayer, XTRA_OFS_WEAPON)
if(is_user_connected(id))
{
emit_sound(id, CHAN_WEAPON, g_szBurstSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
return HAM_IGNORED
}

public Fw_TraceAttack_World(victim, attacker, Float:damage, Float:direction[3], prt, damage_bits)
{
if(!is_user_connected(attacker))
return HAM_IGNORED

if(get_user_weapon(attacker) == CSW_KNIFE)
return HAM_IGNORED

static Float:origin[3], Float:vecPlane[3]
get_tr2(prt, TR_vecEndPos, origin)
get_tr2(prt, TR_vecPlaneNormal, vecPlane)

makeBulletHole(victim, attacker, origin)
makeBulletSmoke(attacker, prt)
return HAM_IGNORED
}

public ham_WeaponDeploy_Post(const iWeapon)
{
static id; id = get_pdata_cbase(iWeapon, m_pPlayer, XTRA_OFS_WEAPON)
if(is_user_connected(id))
{
new Float:fTime = 0.1
if(get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == CSW_M3 || get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == CSW_XM1014)
{
return HAM_IGNORED
}

set_task(fTime, "playDeploySound", id + TASK_PLAYSOUND)
}

return HAM_IGNORED
}

public playDeploySound(id)
{
id -= TASK_PLAYSOUND
client_cmd(id, "spk ^"%s^"", AllWeapons[get_user_weapon(id)][szDeploySound])
}

public Fw_UpdateClientData_Post(id, sendweapons, cd_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED

if(get_user_weapon(id) == CSW_KNIFE)
return FMRES_IGNORED

set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
return FMRES_HANDLED
}

public fw_PlaybackEvent(flags, id, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if(!is_user_connected(id))
return FMRES_IGNORED

new iUserWeapon = get_user_weapon(id)
if(!AllWeapons[iUserWeapon][szFireSound][0])
return FMRES_IGNORED

new iIsWeaponSilenced = cs_get_weapon_silen(get_pdata_cbase(id, m_pActiveItem))
if(iUserWeapon == CSW_M4A1)
{
emit_sound(id, CHAN_WEAPON, iIsWeaponSilenced ? g_szM4A4FireSoundSilencer : g_szM4A4FireSoundNoSilencer, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
else if(iUserWeapon == CSW_USP)
{
emit_sound(id, CHAN_WEAPON, iIsWeaponSilenced ? g_szUSPFireSoundSilencer : g_szUSPFireSoundNoSilencer, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
else emit_sound(id, CHAN_WEAPON, AllWeapons[iUserWeapon][szFireSound], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

if(iUserWeapon == CSW_ELITE)
{
g_iFireValue[id] = (g_iFireValue[id] == LEFT_PISTOL) ? RIGHT_PISTOL : LEFT_PISTOL

new iClip;get_user_weapon(id, iClip)
if(iClip == 2)
{
g_iFireValue[id] += 1
}
}

if(iIsWeaponSilenced)
{
AllWeapons[iUserWeapon][iFireAnimation] = 2
}
else if(iUserWeapon == CSW_USP)
{
AllWeapons[iUserWeapon][iFireAnimation] = 9
}
else if(iUserWeapon == CSW_M4A1)
{
AllWeapons[iUserWeapon][iFireAnimation] = 9
}

SendWeaponAnim(id, (iUserWeapon == CSW_ELITE) ? g_iFireValue[id] : AllWeapons[iUserWeapon][iFireAnimation])
engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, id, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
makeShells(id)
return FMRES_SUPERCEDE
}

makeShells(id)
{
static Float:player_origin[3], Float:origin[3], Float:origin2[3], Float:gunorigin[3], Float:oldangles[3], Float:v_forward[3], Float:v_forward2[3], Float:v_up[3], Float:v_up2[3], Float:v_right[3], Float:v_right2[3], Float:viewoffsets[3];

pev(id,pev_v_angle, oldangles); pev(id,pev_origin,player_origin); pev(id, pev_view_ofs, viewoffsets);

engfunc(EngFunc_MakeVectors, oldangles)

global_get(glb_v_forward, v_forward); global_get(glb_v_up, v_up); global_get(glb_v_right, v_right);
global_get(glb_v_forward, v_forward2); global_get(glb_v_up, v_up2); global_get(glb_v_right, v_right2);

xs_vec_add(player_origin, viewoffsets, gunorigin);

xs_vec_mul_scalar(v_forward, 10.3, v_forward); xs_vec_mul_scalar(v_right, 2.9, v_right);
xs_vec_mul_scalar(v_up, -3.7, v_up);
xs_vec_mul_scalar(v_forward2, 10.0, v_forward2); xs_vec_mul_scalar(v_right2, 3.0, v_right2);
xs_vec_mul_scalar(v_up2, -4.0, v_up2);

xs_vec_add(gunorigin, v_forward, origin);
xs_vec_add(gunorigin, v_forward2, origin2);
xs_vec_add(origin, v_right, origin);
xs_vec_add(origin2, v_right2, origin2);
xs_vec_add(origin, v_up, origin);
xs_vec_add(origin2, v_up2, origin2);

static Float:velocity[3]
getSpeedVector(origin2, origin, random_float(140.0, 160.0), velocity)

static angle; angle = random_num(0, 360)

message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
write_byte(TE_MODEL)
engfunc(EngFunc_WriteCoord, origin[0])
engfunc(EngFunc_WriteCoord,origin[1])
engfunc(EngFunc_WriteCoord,origin[2])
engfunc(EngFunc_WriteCoord,velocity[0])
engfunc(EngFunc_WriteCoord,velocity[1])
engfunc(EngFunc_WriteCoord,velocity[2])
write_angle(angle)
write_short(g_iShellModel)
write_byte(1)
write_byte(20)
message_end()
}

getSpeedVector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
new_velocity[0] = origin2[0] - origin1[0]
new_velocity[1] = origin2[1] - origin1[1]
new_velocity[2] = origin2[2] - origin1[2]
new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
new_velocity[0] *= num
new_velocity[1] *= num
new_velocity[2] *= num

return 1;
}

makeBulletSmoke(id, TrResult)
{
static Float:vecSrc[3], Float:vecEnd[3], TE_FLAG;

getWeaponAttachment(id, vecSrc);
global_get(glb_v_forward, vecEnd);

xs_vec_mul_scalar(vecEnd, 8192.0, vecEnd);
xs_vec_add(vecSrc, vecEnd, vecEnd);

get_tr2(TrResult, TR_vecEndPos, vecSrc);
get_tr2(TrResult, TR_vecPlaneNormal, vecEnd);

xs_vec_mul_scalar(vecEnd, 2.5, vecEnd);
xs_vec_add(vecSrc, vecEnd, vecEnd);

TE_FLAG |= TE_EXPLFLAG_NODLIGHTS;
TE_FLAG |= TE_EXPLFLAG_NOSOUND;
TE_FLAG |= TE_EXPLFLAG_NOPARTICLES;

engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, vecEnd, 0);
write_byte(TE_EXPLOSION);
engfunc(EngFunc_WriteCoord, vecEnd[0]);
engfunc(EngFunc_WriteCoord, vecEnd[1]);
engfunc(EngFunc_WriteCoord, vecEnd[2] - 10.0);
write_short(g_iSmokeSprite);
write_byte(5);
write_byte(50);
write_byte(TE_FLAG);
message_end();
}

getWeaponAttachment(id, Float:output[3], Float:fDis = 40.0)
{
static Float:vfEnd[3], viEnd[3] ;
get_user_origin(id, viEnd, 3);
IVecFVec(viEnd, vfEnd);

static Float:fOrigin[3], Float:fAngle[3];

pev(id, pev_origin, fOrigin);
pev(id, pev_view_ofs, fAngle);

xs_vec_add(fOrigin, fAngle, fOrigin);

static Float:fAttack[3];

xs_vec_sub(vfEnd, fOrigin, fAttack);
xs_vec_sub(vfEnd, fOrigin, fAttack);

static Float:fRate;

fRate = fDis / vector_length(fAttack);
xs_vec_mul_scalar(fAttack, fRate, fAttack);

xs_vec_add(fOrigin, fAttack, output);
}

makeBulletHole(victim, attacker, Float:origin[3])
{
static decal
decal = random_num(41, 45);

if(victim)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
engfunc(EngFunc_WriteCoord, origin[0])
engfunc(EngFunc_WriteCoord, origin[1])
engfunc(EngFunc_WriteCoord, origin[2])
write_byte(decal)
write_short(victim)
message_end()
}
else
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
engfunc(EngFunc_WriteCoord, origin[0])
engfunc(EngFunc_WriteCoord, origin[1])
engfunc(EngFunc_WriteCoord, origin[2])
write_byte(decal)
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
engfunc(EngFunc_WriteCoord, origin[0])
engfunc(EngFunc_WriteCoord, origin[1])
engfunc(EngFunc_WriteCoord, origin[2])
write_short(attacker)
write_byte(decal)
message_end()
}

SendWeaponAnim(id, iAnim)
{
set_pev(id, pev_weaponanim, iAnim)

message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id)
write_byte(iAnim)
write_byte(pev(id, pev_body))
message_end()
}
 
Последнее редактирование:

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

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