M3 fire sound

Сообщения
29
Реакции
4
Помог
1 раз(а)
Ошибка
None.
ОС
Linux
Amx Mod X
AMX Mod X 1.8.3-dev+5154 (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: Mar 11 2018 07:25:29
Built from: https://github.com/alliedmodders/amxmodx/commit/2559fcf0
Build ID: 5154:2559fcf0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 09:10:05 Jul 7 2017 (7561)
ReGamedll
ReGameDLL version: 5.7.0.312-dev
Build date: 07:53:34 May 31 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/26db32e
Версия Metamod
Metamod v1.21-am  2013-03-15 (5:13)
by Will Day <[email protected]>
http://www.metamod.org/
compiled: Mar 15 2013, 15:20:21 (msc optimized)
Список метамодулей
[ 1] AMX Mod X        RUN   -    amxmodx_mm_i386.  v1.8.3-d  ini   Start ANY  
[ 2] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-d pl1 ANY ANY
[ 3] CSX RUN - csx_amxx_i386.so v1.8.3-d pl1 ANY ANY
[ 4] Engine RUN - engine_amxx_i386 v1.8.3-d pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-d pl1 ANY ANY
[ 6] ReAPI RUN - reapi_amxx_i386. v5.6.0.1 pl1 ANY Never
Список плагинов
[  1] Admin Base              1.8.3-dev+  AMXX Dev Team     admin.amxx       running  
[ 2] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.8.3-dev+ AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.8.3-dev+ AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.8.3-dev+ AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.8.3-dev+ AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.3-dev+ AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.8.3-dev+ AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.8.3-dev+ AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.8.3-dev+ AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.8.3-dev+ AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.8.3-dev+ AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.8.3-dev+ AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.8.3-dev+ AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.8.3-dev+ AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.8.3-dev+ AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.8.3-dev+ AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.8.3-dev+ AMXX Dev Team statsx.amxx running
[ 22] [AMXX] Settings API 1.0 MeRcyLeZZ amx_settings_ap running
[ 23] Aliens vs Predator Mod v1.0.2 Crazy aliens_vs_preda debug
[ 24] [AvP] Weapons v1.0.2 Crazy avp_weapons.amx debug
[ 25] [AvP] Abilities v1.0.2 Crazy avp_abilities.a debug
[ 26] [AvP] M-4A4 Pistol v1.0.2 Crazy avp_m4a4_pistol debug
[ 27] [AvP] Shotgun v1.0.2 Crazy avp_shotgun.amx debug
[ 28] [AvP] Default Weapons v1.0.2 Crazy avp_default_wea debug
[ 29] [AvP] Ability: Motion v1.0.2 Crazy avp_ability_mot debug
[ 30] [AvP] Alien Species v1.0.2 Crazy avp_alien_speci debug
[ 31] [AvP] Marine Species v1.0.2 Crazy avp_marine_spec debug
[ 32] [AvP] Marine Class 1.0 Crazy avp_marine_clas debug
[ 33] [AvP] Gameplay Fixes v1.0.2 Crazy avp_gameplay_fi debug
Автор плагина
Crazy
Версия плагина
v1.0.2
Исходный код
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <avp_marine_species>

const SHOTGUN_WEAPONBOX_KEY = 1001;

#define isShotgun(%1) (get_entvar(%1, var_impulse) == SHOTGUN_WEAPONBOX_KEY)

enum _:eWeaponModel
{
WEAPON_V_MODEL = 0,
WEAPON_P_MODEL,
WEAPON_W_MODEL,
};

enum _:eWeaponAnim
{
WEAPON_IDLE = 0,
WEAPON_SHOOT1,
WEAPON_SHOOT2,
WEAPON_RELOAD2,
WEAPON_RELOAD3,
WEAPON_RELOAD1,
WEAPON_DRAW,
};

new const g_szShotgunModels[eWeaponModel][] =
{
"models/avp/v_shotgun.mdl",
"models/p_m3.mdl",
"models/w_m3.mdl"
};

new const g_szSoundShotgunFire[] = "avp/shotgun_fire.wav";
new const g_szSoundWeaponEmpty[] = "weapons/dryfire_rifle.wav";
new const g_szM3Ent[] = "weapon_m3";

new g_iShotgunId, g_iMsgWeaponList;
new pCvarShotgunMaxRounds, pCvarShotgunClipSize; //pCvarShotgunDamage;

public plugin_init()
{
pCvarShotgunClipSize = register_cvar("avp_shotgun_ammo", "6");
pCvarShotgunMaxRounds = register_cvar("avp_shotgun_bpammo", "42");
//pCvarShotgunDamage = register_cvar("avp_shotgun_damage", "35");
g_iMsgWeaponList = get_user_msgid("WeaponList");

register_clcmd("weapon_shotgun", "cmdShotgun");

RegisterHam(Ham_Item_Deploy, g_szM3Ent, "CM3_Deploy_Post", 1);
RegisterHam(Ham_Weapon_PrimaryAttack, g_szM3Ent, "CM3_PrimaryAttack");
RegisterHam(Ham_Weapon_Reload, g_szM3Ent, "CM3_Reload");
RegisterHam(Ham_Weapon_Reload, g_szM3Ent, "CM3_Reload_Post", 1);
RegisterHam(Ham_Item_AddToPlayer, g_szM3Ent, "CM3_AddToPlayer_Post", 1);

RegisterHookChain(RG_CWeaponBox_SetModel, "CWeaponBox_SetModel");
RegisterHookChain(RG_CSGameRules_CanHavePlayerItem, "CBasePlayer_CanHaveItem");

register_forward(FM_UpdateClientData, "CBasePlayer_UpdateData_Post", 1);
}

public plugin_precache()
{
register_plugin("[AvP] Shotgun", AVP_VERSION_STR, "Crazy");

g_iShotgunId = avp_weapon_add("Shotgun", AVP_TEAM_MARINE);

for (new i = WEAPON_V_MODEL; i <= WEAPON_W_MODEL; i++)
precache_model(g_szShotgunModels[i]);

precache_generic("sprites/avp/640hud1.spr");
precache_generic("sprites/weapon_shotgun.txt");

precache_sound(g_szSoundShotgunFire);
}

public avp_fw_give_weapon(this, iWeaponId)
{
if (iWeaponId != g_iShotgunId)
return;

rg_remove_item(this, g_szM3Ent, true);

new pevWeapon = rg_give_item(this, g_szM3Ent);
new iMaxRounds = get_pcvar_num(pCvarShotgunMaxRounds);
new iClipSize = get_pcvar_num(pCvarShotgunClipSize);

set_entvar(pevWeapon, var_impulse, SHOTGUN_WEAPONBOX_KEY);
rg_set_iteminfo(pevWeapon, ItemInfo_iMaxClip, iClipSize);
rg_set_iteminfo(pevWeapon, ItemInfo_iMaxAmmo1, iMaxRounds);
rg_set_user_bpammo(this, WEAPON_M3, iMaxRounds);
set_member(pevWeapon, m_Weapon_iClip, iClipSize);

ExecuteHamB(Ham_Item_AddToPlayer, pevWeapon, this);
rg_switch_weapon(this, pevWeapon);
}

public avp_fw_can_have_weapon(this, iWeaponId)
{
if (iWeaponId != g_iShotgunId)
return AVP_CONTINUE;

new iClassId = avp_marine_class_get(this);

if (!(avp_marine_class_get_weapons(iClassId) & (1<<iWeaponId)))
return AVP_SUPERCEDE;

return AVP_CONTINUE;
}

public cmdShotgun(this)
{
engclient_cmd(this, "weapon_m3");
}

public CM3_Deploy_Post(this)
{
if (!isShotgun(this))
return;

new pevOwner = get_member(this, m_pPlayer);

set_entvar(pevOwner, var_viewmodel, g_szShotgunModels[WEAPON_V_MODEL]);
set_entvar(pevOwner, var_weaponmodel, g_szShotgunModels[WEAPON_P_MODEL]);
set_member(this, m_Weapon_flAccuracy, 0.9);
setWeaponTimeBase(this, 0.75);

ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, WEAPON_DRAW, false);
}

public CM3_PrimaryAttack(this)
{
if (!isShotgun(this))
return HAM_IGNORED;

client_print(0, print_chat, "isShotgun");

new pevOwner = get_member(this, m_pPlayer);

if (get_entvar(pevOwner, var_waterlevel) == 3)
{
emit_sound(pevOwner, CHAN_WEAPON, g_szSoundWeaponEmpty, 0.8, ATTN_NORM, 0, PITCH_NORM);

set_member(this, m_Weapon_flNextPrimaryAttack, 0.15);
return HAM_SUPERCEDE;
}

new iClip = get_member(this, m_Weapon_iClip);

if (iClip <= 0)
{
ExecuteHamB(Ham_Weapon_Reload, this);

if (!get_member(this, m_Weapon_iClip))
emit_sound(pevOwner, CHAN_WEAPON, g_szSoundWeaponEmpty, 0.8, ATTN_NORM, 0, PITCH_NORM);

set_member(this, m_Weapon_flNextPrimaryAttack, 1.0);
return HAM_SUPERCEDE;
}

iClip--;

set_member(this, m_Weapon_iClip, iClip);
rg_set_animation(pevOwner, PLAYER_ATTACK1);

emit_sound(pevOwner, CHAN_WEAPON, g_szSoundShotgunFire, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, random_num(WEAPON_SHOOT1, WEAPON_SHOOT2), false);
fireBullets(this);

set_member(this, m_Weapon_flNextPrimaryAttack, 0.875);
set_member(this, m_Weapon_flNextSecondaryAttack, 0.875);
set_member(this, m_Weapon_fInSpecialReload, 0);

if (iClip > 0)
{
set_member(this, m_M3_flPumpTime, 0.5);
set_member(this, m_Weapon_flTimeWeaponIdle, 2.5);
}
else
{
set_member(this, m_Weapon_flTimeWeaponIdle, 0.875);
}

new Float:flGlbTime, Float:vecPunchAngle[3], Float:flRandomNumbers[3];

global_get(glb_time, flGlbTime);
get_entvar(pevOwner, var_punchangle, vecPunchAngle);

if (get_entvar(pevOwner, var_flags) & FL_ONGROUND)
{
flRandomNumbers[0] = get_member(pevOwner, random_seed) + 1.0;
flRandomNumbers[1] = 4.0;
flRandomNumbers[2] = 6.0;
}
else
{
flRandomNumbers[0] = get_member(pevOwner, random_seed) + 1.0;
flRandomNumbers[1] = 8.0;
flRandomNumbers[2] = 11.0;
}

vecPunchAngle[0] -= flRandomNumbers[random(sizeof flRandomNumbers)];

set_entvar(pevOwner, var_punchangle, vecPunchAngle);
set_member(pevOwner, m_flEjectBrass, flGlbTime + 0.45);

return HAM_SUPERCEDE;
}

public CM3_Reload(this)
{
if (!isShotgun(this))
return HAM_IGNORED;

new pevOwner = get_member(this, m_pPlayer);
new iAmmo = min(get_pcvar_num(pCvarShotgunClipSize) - get_member(this, m_Weapon_iClip), get_member(pevOwner, m_rgAmmo, get_member(this, m_Weapon_iPrimaryAmmoType)))

if (iAmmo == 0)
return HAM_SUPERCEDE;

if (get_member(this, m_Weapon_flNextPrimaryAttack) > 0.0)
return HAM_SUPERCEDE;

return HAM_IGNORED;
}

public CM3_Reload_Post(this)
{
if (!isShotgun(this))
return;

if (GetHamReturnStatus() == HAM_SUPERCEDE)
return;

/*new

if (get_member(this, m_Weapon_fInReload))
{

}

new pevOwner = get_member(this, m_pPlayer);

set_member(pevOwner, m_flTimeWeaponIdle, 1.85);
set_member(pevOwner, m_flNextAttack, 1.85);*/

//ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, this, WEAPON_RELOAD, false);
}

public CM3_AddToPlayer_Post(this, pevPlayer)
{
if (!is_entity(this))
return;

if (!is_user_alive(pevPlayer))
return;

if (!isShotgun(this))
return;

message_begin(MSG_ONE, g_iMsgWeaponList, .player = pevPlayer)
{
write_string("weapon_shotgun");
write_byte(get_member(this, m_Weapon_iPrimaryAmmoType));
write_byte(rg_get_iteminfo(this, ItemInfo_iMaxAmmo1));
write_byte(get_member(this, m_Weapon_iSecondaryAmmoType));
write_byte(rg_get_iteminfo(this, ItemInfo_iMaxAmmo2));
write_byte(rg_get_iteminfo(this, ItemInfo_iSlot));
write_byte(rg_get_iteminfo(this, ItemInfo_iPosition));
write_byte(CSW_M3);
write_byte(0);
}
message_end();
}

public CWeaponBox_SetModel(this, const szModel[])
{
new pevWeapon;

for (new i = 0; i < MAX_ITEM_TYPES; i++)
{
pevWeapon = get_member(this, m_WeaponBox_rgpPlayerItems, i);

if (!is_entity(pevWeapon))
continue;

if (!isShotgun(pevWeapon))
continue;

SetHookChainArg(2, ATYPE_STRING, g_szShotgunModels[WEAPON_W_MODEL]);
break;
}

return HC_CONTINUE;
}

public CBasePlayer_CanHaveItem(this, pevWeapon)
{
if (!is_user_alive(this))
return HC_CONTINUE;

if (!isShotgun(pevWeapon))
return HC_CONTINUE;

if (avp_can_have_weapon(this, g_iShotgunId))
return HC_CONTINUE;

SetHookChainReturn(ATYPE_INTEGER, false);
return HC_SUPERCEDE;
}

public CBasePlayer_UpdateData_Post(this, iSendWeapons, hClientData)
{
if (!is_user_alive(this))
return;

static pevWeapon;

pevWeapon = get_member(this, m_pActiveItem);

if (!is_entity(pevWeapon))
return;

if (!isShotgun(pevWeapon))
return;

set_cd(hClientData, CD_flNextAttack, 2.0);
}

setWeaponTimeBase(this, Float:flTime)
{
set_member(this, m_Weapon_flNextPrimaryAttack, flTime);
set_member(this, m_Weapon_flNextReload, flTime);
set_member(this, m_Weapon_flTimeWeaponIdle, flTime);
}

fireBullets(this)
{
new Float:vecSrc[3], Float:vecDir[3], Float:vecViewAngle[3], Float:vecPunchAngle[3];

new pevOwner = get_member(this, m_pPlayer);

get_entvar(pevOwner, var_v_angle, vecViewAngle);
get_entvar(pevOwner, var_punchangle, vecPunchAngle);
xs_vec_add(vecViewAngle, vecPunchAngle, vecViewAngle);

engfunc(EngFunc_MakeVectors, vecViewAngle);

ExecuteHamB(Ham_Player_GetGunPosition, pevOwner, vecSrc);
global_get(glb_v_forward, vecDir);

rg_fire_bullets(this, pevOwner, 9, vecSrc, vecDir, Float:{0.0675, 0.0675, 0.0}, 3000.0, BULLET_PLAYER_BUCKSHOT, 0, 0);
engfunc(EngFunc_PlaybackEvent, FEV_HOSTONLY, pevOwner, get_member(this, m_M3_usFire), 0.0, NULL_VECTOR, NULL_VECTOR, 0.0, 0.0, 0, 0, false, false);
}
Hello, I'm trying to set custom fire sounds in M3. I've already removed client prediction, it's working but sound is not being emitted. I've test with other weapons and it's working fine, this problem only happens with M3.
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
Did you tried to send sound with another channel?
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
I've tested and it's working, but the default m3 fire sound is still being emitted. Also I've tested without emulate playback event and what I've realized was that if I don't emulate the event I can play custom fire sounds, but the decal effects of rg_fire_bullets they not are shown..
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
Sorry for the new reply, but I ended up observing that this only happens in the "player's view", maybe due the client side, but the fact is the other players can hear the custom fire sound, only the weapon owner cannot hear.

One correction related to the main post is that I've tested again with ak47 and it's with the same problem, only p228 is being able to emit custom fire sounds.

By any chance, is there no other way to emulate the decal effects?
 
Сообщения
198
Реакции
273
Помог
5 раз(а)
CrazY, try:
Код:
public CBasePlayer_UpdateData_Post(this, iSendWeapons, hClientData)
{
    if (!is_user_alive(this))
-        return;
+        return FMRES_IGNORED;
    static pevWeapon;

    pevWeapon = get_member(this, m_pActiveItem);
  
    if (!is_entity(pevWeapon))
-        return;
+        return FMRES_IGNORED;

    if (!isShotgun(pevWeapon))
-        return;
+        return FMRES_IGNORED;

    set_cd(hClientData, CD_flNextAttack, 2.0);
+   return FMRES_HANDLED;
}
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
Thanks, but as far I know return values it's ignored in post callbacks. Anyway, I've tested and it's still with the same problem.
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
You dont need FM_UpdateClientData hook, try without it
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
I've tested, but still continue the same, decal effects working fine but weapon fire sound still default and not the one I've emitted.
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
That's weird. Can you create minimal example script that reproduces problem?
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
Here's an example, the entire ak47 code is not implemented, but it is the basis.

Код:
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

#define AK47_RANGE_MODIFER 0.98

new const g_szSoundMp5Fire[] = "weapons/mp5-1.wav";
new const g_pszNameAk47[] = "weapon_ak47";

public plugin_init()
{
    register_plugin("Custom Fire Sound", "1.0", "Crazy");

    register_clcmd("say ak", "cmdAk");

    RegisterHam(Ham_Weapon_PrimaryAttack, g_pszNameAk47, "CAK47_PrimaryAttack");

    //register_forward(FM_UpdateClientData, "CBasePlayer_UpdateData_Post", 1);
}

public plugin_precache()
{
    precache_sound(g_szSoundMp5Fire);
}

public cmdAk(this)
{
    rg_give_item(this, g_pszNameAk47, GT_REPLACE);
    rg_set_user_bpammo(this, WEAPON_AK47, rg_get_weapon_info(WEAPON_AK47, WI_MAX_ROUNDS));
}

public CAK47_PrimaryAttack(this)
{
    new Float:vecVelocity[3], Float:flSpread;

    new pevOwner = get_member(this, m_pPlayer);
    new Float:flAccuracy = get_member(this, m_Weapon_flAccuracy);

    get_entvar(pevOwner, var_velocity, vecVelocity);

    if (!(get_entvar(pevOwner, var_flags) & FL_ONGROUND))
        flSpread = 0.04 + (0.4 * flAccuracy);
    else if (xs_vec_len_2d(vecVelocity) > 140.0)
        flSpread = 0.04 + (0.07 * flAccuracy);
    else
        flSpread = 0.0275 * flAccuracy;

    emit_sound(pevOwner, CHAN_WEAPON, g_szSoundMp5Fire, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
    
    CAK47_Fire(this, pevOwner, flSpread);

    set_member(this, m_Weapon_flNextPrimaryAttack, 0.4);

    //emit_sound(pevOwner, CHAN_WEAPON, g_szSoundMp5Fire, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

    return HAM_SUPERCEDE;
}

/*public CBasePlayer_UpdateData_Post(this, iSendWeapons, hClientData)
{
    if (!is_user_alive(this))
        return;

    static pevWeapon;

    pevWeapon = get_member(this, m_pActiveItem);

    if (is_nullent(pevWeapon))
        return;

    if (get_member(pevWeapon, m_iId) != WEAPON_AK47)
        return;

    set_cd(hClientData, CD_flNextAttack, 2.0);
}*/

CAK47_Fire(this, pevAttacker, Float:flSpread)
{
    new Float:vecSrc[3], Float:vecDirShooting[3], Float:vecPunchAngle[3];

    ExecuteHamB(Ham_Player_GetGunPosition, pevAttacker, vecSrc);
    global_get(glb_v_forward, vecDirShooting);
    get_entvar(pevAttacker, var_punchangle, vecPunchAngle);

    rg_fire_bullets3(this, pevAttacker, vecSrc, vecDirShooting, flSpread, 8192.0, 2, BULLET_PLAYER_762MM, 36, AK47_RANGE_MODIFER, false, get_member(pevAttacker, random_seed));
    engfunc(EngFunc_PlaybackEvent, FEV_HOSTONLY, pevAttacker, get_member(this, m_AK47_usFire), 0.0, NULL_VECTOR, NULL_VECTOR, 0.0, 0.0, floatround(vecPunchAngle[0] * 100.0), floatround(vecPunchAngle[1] * 100.0), false, false);
}
 
Сообщения
855
Реакции
532
Помог
13 раз(а)
Я просто оставлю это здесь.
Ваш метод - ******. Я вам даже ссылку на уже фактически готовый код дал. Удачного дня.

1532346401046.png
 

Garey

ninjaCow
Сообщения
440
Реакции
1,092
Помог
11 раз(а)
BalbuR и как он будет с скриншота переводить? :интересно:
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
BalbuR, ничего что стандартный эвент атаки полностью блочится? Какой такой дополнительный SVC?
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
voed, предиктинг никто не отменял. Клиент будет пытаться угадать анимации и воспроизводить их, пока ответ от сервера идет.
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
fl0wer, предиктинг работает по эвенту, когда у эвента флаг hostonly, клиент даже не знает что мы собираемся стрелять
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
voed, у тебя все равно будет проскакивать анимации (не на локалке).
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
CrazY, well, after some tests, first of all you need to fix this
engfunc(EngFunc_PlaybackEvent, FEV_HOSTONLY, pevAttacker, get_member(this, m_AK47_usFire), ...
>>
engfunc(EngFunc_PlaybackEvent, FEV_HOSTONLY, this, get_member(this, m_AK47_usFire), ...
but anyway it will just override sound on weapon channel, not replace it
 
Сообщения
29
Реакции
4
Помог
1 раз(а)
Umm, so it's not possible to precache a null sound instead of default weapon fire sound? Example.

Код:
#include <amxmodx>
#include <fakemeta>

new g_hFMPrecacheSound;

public plugin_init()
{
    register_plugin("Null precache", "1.0", "Crazy");

    unregister_forward(FM_PrecacheSound, g_hFMPrecacheSound);
}

public plugin_precache()
{
    g_hFMPrecacheSound = register_forward(FM_PrecacheSound, "pfnPrecacheSound");   
}

public pfnPrecacheSound(const szSound[])
{
    if (!equali(szSound, "weapon/ak47-1.wav") && !equali(szSound, "weapon/ak47-2.wav"))
        return FMRES_IGNORED;

    forward_return(FMV_CELL, precache_sound("common/null.wav"));
    //forward_return(FMV_STRING, "common/null.wav");
    return FMRES_SUPERCEDE;
}
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Is it on server? Okay(
 

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

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