Raised This Month: $51 Target: $400
 12% 

Sound Replace


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NooTy
Member
Join Date: Sep 2019
Old 06-15-2020 , 08:08   Sound Replace
Reply With Quote #1

Hey, I wanna help in this code
Code:
public fw_EmitSound(id, channel, String:sample[], Float:volume, Float:attn, flags, pitch)
{
    if (!is_user_connected(id))
    {
        return 1;
    }
	if (scmode[id] && equal(sample[8], "mp5",3))
    {
        if (equal(sample[14], "sho",3))
        volume = 0.60/*1058642330*/;
        {
        if (equal(sample, "weapons/mp5-1.wav"))
        {
	    emit_sound(id, CHAN_ITEM, "Brawl_Stars/effects/colt_attack.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        if (equal(sample, "weapons/mp5-2.wav"))
        {
            emit_sound(id, CHAN_ITEM, "Brawl_Stars/effects/colt_attack.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
}
        }

	if (skmode[id] && equal(sample[8], "kni",3))
    {
        volume = 0.60/*1058642330*/;
        if (equal(sample[14], "sla",3))
        {
            engfunc(EngFunc_EmitSound, id, channel, "Brawl_Stars/effects/mortis_attack.wav", volume, attn, flags, pitch);
            return 4;
        }
}
    return FMRES_IGNORED;
}
when i slap with knife work but mp5 not work
NooTy is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-15-2020 , 10:04   Re: Sound Replace
Reply With Quote #2

Quote:
Originally Posted by Arkshine View Post
Weapon sounds, except for knife, can't be hooked since they are played client-side.

I don't think inserting the fire sound into the weapon will block the sound played on the client.

To have your own sounds, you have to redo the whole weapon as amxx plugin, which is not that hard.
You can't replace but override it. Hook PrimaryAttack Post then try emit the shooting sound there
Other way could be block the shooting effect (but it also block shoot anim, bullet hole, bullet smoke, crosshair recoil changing,...) and emit it there but if you only need to change shooting sound, it is at bit too much
__________________
My plugin:

Last edited by Celena Luna; 06-15-2020 at 10:08.
Celena Luna is offline
NooTy
Member
Join Date: Sep 2019
Old 06-16-2020 , 02:50   Re: Sound Replace
Reply With Quote #3

Quote:
Originally Posted by Celena Luna View Post
You can't replace but override it. Hook PrimaryAttack Post then try emit the shooting sound there
Other way could be block the shooting effect (but it also block shoot anim, bullet hole, bullet smoke, crosshair recoil changing,...) and emit it there but if you only need to change shooting sound, it is at bit too much
thx moon
NooTy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode