| closedAllies/Axis win event |
| Started by grambler1 on 09-01-2011, 03:07 PM |
Threads: 1
Joined: Sep 2011
I'm editing the amxmodx stats.sma file and want to add custom sounds when either the Allies or the Axis wins a round (capping all flags), which are different depending on who wins.rnrnI'm pretty sure that I know how to add the sound playing, and I know how to precache sounds, so the thing I am after is a piece of code:rnrnif ( Axis win ){rn Playsound1rn}rnif ( Allies win ){rn Playsound2rn}rnrnI would like the sounds to overwrite the default win ones, is this doable?rnWould I have to compile the stats.sma file after editing and replace it with the one under HLServerdodaddonsamxmodxpluginsstats.amxx?rnGet me? Else write in the comments.
Threads: 24
Joined: Oct 2006
Register the win events (in plugin_init) to call the desired routine...rnregister_event("RoundState", "ally_win", "a", "1=3")rnregister_event("RoundState", "axis_win", "a", "1=4")rnrnrnpublic ally_win()rn{rn 'play ally sound'rn}rnrnpublic axis_win()rn{rn 'play axis sound'rn}rnrnNote: This method will NOT overwrite the default win sounds.
Threads: 1
Joined: Sep 2011
Hey Vet, thank you very much for your reply. I think this is just what I'm looking for!nI don't have time to test it right now, will do it later tonight.nnWould it be possible to overwrite the sounds in a much simpler way by editing the .bsp file? (For a single map)
Threads: 24
Joined: Oct 2006
Yes, for just a single map, changing the entity in the .bsp would be the easiest way. Just don't forget to add the new sound file to a .res file.rnrnIf you want to alter the victory songs of the vast majority of maps, trap keyvalues and look for, and change, the 3 primary wav files (britwin.wav, germanwin.wav and uswin.wav).

