AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   FM_EmitSound ? (https://forums.alliedmods.net/showthread.php?t=295321)

abdobiskra 03-22-2017 11:45

FM_EmitSound ?
 
Hi, I tried to change the sound but it did not work where was the problem?

PHP Code:

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_EmitSound "EmitSound");
}
public 
EmitSound(entitychannel, const sound[])
{
    if(
equal(sound "weapons/cbar_miss1.wav"))
    {
        
emit_sound(entity,  channel"hlzm/claw_miss.wav"1.0ATTN_NORM0PITCH_NORM);
        
client_print(entityprint_chat,"This sound ====> Done!")
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;



OciXCrom 03-22-2017 11:47

Re: FM_EmitSound ?
 
It's probably a client-side sound, so you can't change it.

D3XT3R 03-22-2017 11:49

Re: FM_EmitSound ?
 
wanna sound start when round start or what explain to us...

abdobiskra 03-22-2017 11:55

Re: FM_EmitSound ?
 
Quote:

Originally Posted by OciXCrom (Post 2505721)
It's probably a client-side sound, so you can't change it.

its the sound of weapon crowbare when attacking

abdobiskra 03-22-2017 11:56

Re: FM_EmitSound ?
 
Quote:

Originally Posted by D3XT3R (Post 2505723)
wanna sound start when round start or what explain to us...

when player attack

Depresie 03-22-2017 12:44

Re: FM_EmitSound ?
 
There are some sounds in the game that cannot be replaced because they are client sided ( they are triggered by the client, not the server )

For example, in Counter Strike you cannot replace the weapon firing/reloading etc sounds except for the knife

For Half Life, i don't know

abdobiskra 03-22-2017 12:52

Re: FM_EmitSound ?
 
aa OK i make sur for it now( Ty !

PRoSToTeM@ 03-22-2017 18:00

Re: FM_EmitSound ?
 
Quote:

Originally Posted by Depresie (Post 2505749)
For example, in Counter Strike you cannot replace the weapon firing/reloading

You can replace reloading sounds. Some of their names are located in weapon view model (5004 event), so you can change it in the model and rename this model. And some of them are played by ReloadSound usermsg, so you can block it and play yours sound. Reload sounds in view model are used for 1st person playing and ReloadSound usermsg is used for 3rd person playing (for other players).

abdobiskra 03-23-2017 11:55

Re: FM_EmitSound ?
 
PRoSToTeM@
Is there a code as an example?

Natsheh 03-24-2017 07:33

Re: FM_EmitSound ?
 
make sure the sound that you are replacing with has 176 bit rate...


All times are GMT -4. The time now is 17:58.

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