Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › Help › Scripting Help › Allies/Axis win event
4 posts, 2 people · 989 views Thread Rating: ★★★★★
closedAllies/Axis win event
Started by grambler1 on 09-01-2011, 03:07 PM
G grambler1
started this thread
Posts: 2
Threads: 1
Joined: Sep 2011
09-01-2011, 03:07 PM #1

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.

Vet
posted here
Posts: 229
Threads: 24
Joined: Oct 2006
09-02-2011, 10:29 AM #2

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.

G grambler1
started this thread
Posts: 2
Threads: 1
Joined: Sep 2011
09-02-2011, 10:54 AM #3

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)

Vet
posted here
Posts: 229
Threads: 24
Joined: Oct 2006
09-02-2011, 06:03 PM #4

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).

Archive › Old Forum Threads › Help › Scripting Help › Allies/Axis win event
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC