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 › Changing/Adding sounds? (DoD TK Revenge)
9 posts, 2 people · 1,438 views Thread Rating: ★★★★★
closedChanging/Adding sounds? (DoD TK Revenge)
Started by blobby on 07-21-2007, 10:56 AM
blobby
started this thread
Posts: 421
Threads: 47
Joined: Apr 2007
07-21-2007, 10:56 AM #1

Ok this plugin rocks but i really need to change the sound it plays when the menu is displayed so if you could just point out where on the sma file i can find this i would be very great fullrnrnRegardsrnrnBlobbyrnrnp.S. is there any way to add a sound to the forgive part of this so when it slaps them it says like how stupid do you feel know or something??

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-21-2007, 05:56 PM #2
Ok this plugin rocks but i really need to change the sound it plays when the menu is displayed so if you could just point out where on the sma file i can find this i would be very great fullrnrnRegardsrnrnBlobbyrnrnp.S. is there any way to add a sound to the forgive part of this so when it slaps them it says like how stupid do you feel know or something??
rnrn1. you can change/remove the sound with those lines:rn
client_cmd(param[0],"spk Gman/Gman_Choose1")
rnandrn
client_cmd(param[0],"spk Gman/Gman_Choose2")
rnrn2. that would be possible for sure, look for this code:rn
client_print(0,print_chat, "[DoD TK Revenge] %L",LANG_PLAYER,"SLAPANDFORGIVE",victimname,killername)rnuser_slap(teamkiller[id],0)
rnrnand add a line after user_slap(teamkiller[id],0) containing:rn
emit_sound(teamkiller[id], CHAN_AUTO, "YOURSOUNDHERE.WAV", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
rnrnhope that helps a bit :cool:rnrnrnWell well, looking through the code i realized that i used a big bunch of duplicate code,rnso i'll optimize that for a new version.

blobby
started this thread
Posts: 421
Threads: 47
Joined: Apr 2007
07-22-2007, 09:16 AM #3

Ok so where do i need to locate my sounds on my server?? So say i had this client_cmd(param[0],"spk Gman/how stupid.wav") **I did think this was wrong myself** nnbut if you could help me be able to use my own custom sounds i would be very great fullnnRegardsnnBlobby

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-22-2007, 12:45 PM #4
Ok so where do i need to locate my sounds on my server?? So say i had this client_cmd(param[0],"spk Gman/how stupid.wav") **I did think this was wrong myself** rnrnbut if you could help me be able to use my own custom sounds i would be very great fullrnrnRegardsrnrnBlobby
rnrnyes, that is wrong indeed, place your soundfiles in "/dod/sound/misc/"rnrnan example would be "howstupid.wav", so upload that sound into thernabove folder.rnrn- the sound has to be precached so clients will download it, to do sornadd to the sma:rn
public plugin_precache()rn{rn	if(file_exists("sound/misc/howstupid.wav"))rn	{rn		precache_sound("misc/howstupid.wav")rn	}rn}
rnrn- now the sound has to be played in game:rn
client_cmd(param[0],"spk misc/howstupid")
rnrnNOTE: that example is formated to replace the sound that is played whenrnthe menu pops up!

blobby
started this thread
Posts: 421
Threads: 47
Joined: Apr 2007
07-22-2007, 12:59 PM #5

So does it matter where on the sma i add thisnnpublic plugin_precache()n{n if(file_exists("sound/misc/howstupid.wav"))n {n precache_sound("misc/howstupid.wav")n }n}nnAnd also lol where about could i change where is says forgive on the menu to bitch slap and fogive so that it shows up in the menu as bitch slap and forgive because i have a sound that says bitch slap so i thought i would put that in there tonnRegardsnnBlobbynnP.s I only keep asking loads of questions because i don't want to get it wrong and mess up my server lol

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-22-2007, 01:10 PM #6

the precache function already exists, you will just have to change it from:rn

public plugin_precache()rn{ rn	killerburn = precache_model("sprites/explode1.spr") rn}
rnrntornrn
public plugin_precache()rn{ rn	killerburn = precache_model("sprites/explode1.spr")rn	precache_sound("misc/howstupid.wav")rn}rn
rnrnYou can change what the menu says in the language file, just changern
MENUFORGIVE = Forgive!
in dod_tkrevenge.txtrnto for example:rn
MENUFORGIVE = Bitchslap!
blobby
started this thread
Posts: 421
Threads: 47
Joined: Apr 2007
07-22-2007, 03:34 PM #7

Ok so every where in the code i saw thisnnclient_print(0,print_chat, "[DoD TK Revenge] %L",LANG_PLAYER,"SLAPANDFORGIVE",victimname,killername)nuser_slap(teamkiller[id],0)nemit_sound(teamkiller[id], CHAN_AUTO, "bitchslap.WAV", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)nni added the sound line below every line like that is that correctnnand the sound dl i did thisnnpublic plugin_precache()n{ n killerburn = precache_model("sprites/explode1.spr")n precache_sound("misc/bitchslap.wav")nnIs that correct lol im starting to seem like a noob i aint to good at code but i would love to be able to do let me know if this is correctnnRegardsnnBlobbynnP.S Thankyou m8 for all the time you have given me for help with this

FeuerSturm
posted here
Posts: 166
Threads: 15
Joined: Jun 2007
07-22-2007, 03:50 PM #8

almost correct, just a little correction:rnrn

emit_sound(teamkiller[id], CHAN_AUTO, "misc/bitchslap.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
rnrnthe misc/ is important, other than that it's correct.

blobby
started this thread
Posts: 421
Threads: 47
Joined: Apr 2007
07-23-2007, 07:25 AM #9

Wiked cheers buddy wow you have no idea how much your help is appreciated thanks so much buddynnRegardsnnBlobby

Archive › Old Forum Threads › Help › Scripting Help › Changing/Adding sounds? (DoD TK Revenge)
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC