AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] emit_sound (https://forums.alliedmods.net/showthread.php?t=100919)

4554 08-19-2009 06:43

[HELP] emit_sound
 
Who can help me fix the code?
PHP Code:

public emitsound(idchannelsample[])
{
 if(!
is_user_alive(id) || !is_user_connected(id)) 
  return 
FMRES_IGNORED
 
new temp[2], weapon get_user_weapon(idtemp[0], temp[1])
 if(
weapon == CSW_M3)
 {
   if(
equal(sample,"weapons/m3-1.wav")) 
   {
    
emit_sound(idCHAN_WEAPON"weapons/sadsd-1.wav"0.8ATTN_NORM0PITCH_NORM)
    return 
FMRES_SUPERCEDE
   
}
   if(
equal(sample,"weapons/m3_pump.wav")) 
   {
    
emit_sound(idCHAN_WEAPON"weapons/sadsd_draw.wav"1.0ATTN_NORM0PITCH_NORM)
    return 
FMRES_SUPERCEDE
   
}
   if(
equal(sample,"weapons/m3_insertshell.wav")) 
   {
    
emit_sound(idCHAN_WEAPON"weapons/sadsd.wav"1.0ATTN_NORM0PITCH_NORM)
    return 
FMRES_SUPERCEDE
   
}
  }
 return 
FMRES_IGNORED


I want to change m3 sound but fire sound not work, help +k

ot_207 08-19-2009 06:58

Re: [HELP] emit_sound
 
I suggest using contain() function.

PHP Code:

if (contain(sample"m3-1.wav") != -1)
{
emit_sound(...)
return 
FMRES_SUPERCEDE



Also show the full code.

4554 08-19-2009 07:05

Re: [HELP] emit_sound
 
Not work :(
PHP Code:

if(contain(sample"weapons/m3-1.wav") != -1
{
emit_sound(idCHAN_WEAPON"weapons/asdsd-1.wav"1.0ATTN_NORM0PITCH_NORM)
return 
FMRES_SUPERCEDE



ot_207 08-19-2009 07:35

Re: [HELP] emit_sound
 
Quote:

Originally Posted by ot_207 (Post 905326)
Also show the full code.


Arkshine 08-19-2009 08:38

Re: [HELP] emit_sound
 
You can't hook/replace weapon sounds except for the knife since it's something client-side.

ot_207 08-19-2009 09:15

Re: [HELP] emit_sound
 
Quote:

Originally Posted by Arkshine (Post 905405)
You can't hook/replace weapon sounds except for the knife since it's something client-side.

Lol, I didn't looked carefully at the sounds he wanted to modify. :mrgreen:

4554 08-19-2009 11:16

Re: [HELP] emit_sound
 
yeah. i mean modify sound. how to fix?

Arkshine 08-19-2009 11:24

Re: [HELP] emit_sound
 
Quote:

Originally Posted by Arkshine (Post 905405)
You can't hook/replace weapon sounds except for the knife since it's something client-side.


4554 08-19-2009 11:40

Re: [HELP] emit_sound
 
Sorry, i mean modify m3 fire sound , not knife sound. Can you give me a code?

Arkshine 08-19-2009 11:44

Re: [HELP] emit_sound
 
You CAN NOT replace ANY weapon sounds because these sounds are coded client-side. (except for the knife which is coded server-side )


All times are GMT -4. The time now is 15:03.

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