Raised This Month: $ Target: $400
 0% 

Sound change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 01-06-2013 , 11:41   Sound change
Reply With Quote #1

hello.

this is part of the code that are currently written by me.
this code can change possible by other sounds.
it is not possible to change this sound only ctwin, terwin.
there is a problem with my code?
help me.

thanks.

source code here:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

public plugin_init() 

    
register_plugin("PLUGIN""VERSION""AUTHOR")

    
register_forward(FM_EmitSound"forward_fm_emitsound")
}

new const 
new_ctwin[][] =
{
    
"newsound/ctwin.wav"
}

new const 
new_terwin[][] =
{
    
"newsound/terwin.wav"
}

public 
forward_fm_emitsound(idiChannelsample[], Float:fVolumeFloat:fAttenuationiFlagsiPitch)
{
    if(
equali(sample"radio/ctwin.wav"))
    {
        
engfunc(EngFunc_EmitSoundidCHAN_STATICnew_ctwin1.0ATTN_NORM0PITCH_NORM)
    }
    if(
equali(sample"radio/terwin.wav"))
    {
        
engfunc(EngFunc_EmitSoundidCHAN_STATICnew_terwin1.0ATTN_NORM0PITCH_NORM)
    }

    return 
FMRES_SUPERCEDE

RuRuRu612754 is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-07-2013 , 04:01   Re: Sound change
Reply With Quote #2

Try with

PHP Code:
register_event("SendAudio""Terrorists_win" "a""2&%!MRAD_terwin");
register_event("SendAudio""CounterTerrorists_win""a""2&%!MRAD_ctwin");

public 
Terrorists_win() {
 
client_cmd(0"spk 1.wav");
}

public 
CounterTerrorists_win() {
 
client_cmd(0"spk 2.wav");

__________________
sorry my bad english...

Last edited by alonelive; 01-07-2013 at 04:01.
alonelive is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 01-09-2013 , 06:43   Re: Sound change
Reply With Quote #3

Untested,

Code:
public forward_fm_emitsound(id, iChannel, sample[], Float:fVolume, Float:fAttenuation, iFlags, iPitch) {     if(equali(sample, "radio/ctwin.wav"))     {         engfunc(EngFunc_EmitSound, id, CHAN_STATIC, new_ctwin, 1.0, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE     }     if(equali(sample, "radio/terwin.wav"))     {         engfunc(EngFunc_EmitSound, id, CHAN_STATIC, new_terwin, 1.0, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE     }         return FMRES_IGNORED }
guipatinador is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 01-10-2013 , 12:14   Re: Sound change
Reply With Quote #4

@alonelive and guipatinador
thanks for reply and help.
i'm going test it.
RuRuRu612754 is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 01-10-2013 , 14:02   Re: Sound change
Reply With Quote #5

worked.
however, play with double sound with the original sound.
Quote:
Originally Posted by alonelive View Post
Try with

PHP Code:
register_event("SendAudio""Terrorists_win" "a""2&%!MRAD_terwin");
register_event("SendAudio""CounterTerrorists_win""a""2&%!MRAD_ctwin");

public 
Terrorists_win() {
 
client_cmd(0"spk 1.wav");
}

public 
CounterTerrorists_win() {
 
client_cmd(0"spk 2.wav");

do not work.T^T
Quote:
Originally Posted by guipatinador View Post
Untested,

Code:
public forward_fm_emitsound(id, iChannel, sample[], Float:fVolume, Float:fAttenuation, iFlags, iPitch) {     if(equali(sample, "radio/ctwin.wav"))     {         engfunc(EngFunc_EmitSound, id, CHAN_STATIC, new_ctwin, 1.0, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE     }     if(equali(sample, "radio/terwin.wav"))     {         engfunc(EngFunc_EmitSound, id, CHAN_STATIC, new_terwin, 1.0, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE     }         return FMRES_IGNORED }
write by me code.
this is also worked.
however, play with double sound with the original sound.
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <fakemeta> 
#include <fun> 
#include <hamsandwich> 

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

    
register_message(get_user_msgid("TextMsg"), "message_textmsg"); 
}


public 
message_textmsg( const MsgId, const MsgDest, const MsgEntity )
{
    static const 
TerroristMsg[] = "#Terrorists_Win";
    static const 
CTMsg       [] = "#CTs_Win";

    static 
Messagesizeof TerroristMsg ];
    
get_msg_arg_string2MessagecharsmaxMessage ) );

    if ( 
equalMessageTerroristMsg ))
    {
        
client_cmd(0"spk radio/ctwin.wav");
    }
    
    else if ( 
equalMessageCTMsg ))
    {
        
client_cmd(0"spk radio/terwin.wav");
    }

RuRuRu612754 is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-14-2013 , 04:22   Re: Sound change
Reply With Quote #6

PHP Code:
register_event("SendAudio""Terrorists_win" "a""2&%!MRAD_terwin");
register_event("SendAudio""CounterTerrorists_win""a""2&%!MRAD_ctwin");

public 
Terrorists_win() {
 
client_cmd(0"spk 1.wav");
 return 
PLUGIN_HANDLED
}

public 
CounterTerrorists_win() {
 
client_cmd(0"spk 2.wav");
 return 
PLUGIN_HANDLED

__________________
sorry my bad english...
alonelive is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 01-26-2013 , 20:25   Re: Sound change
Reply With Quote #7

Quote:
Originally Posted by alonelive View Post
PHP Code:
register_event("SendAudio""Terrorists_win" "a""2&%!MRAD_terwin");
register_event("SendAudio""CounterTerrorists_win""a""2&%!MRAD_ctwin");

public 
Terrorists_win() {
 
client_cmd(0"spk 1.wav");
 return 
PLUGIN_HANDLED
}

public 
CounterTerrorists_win() {
 
client_cmd(0"spk 2.wav");
 return 
PLUGIN_HANDLED

thanks.
i will try it.
RuRuRu612754 is offline
Reply


Thread Tools
Display Modes

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 13:26.


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