PDA

View Full Version : Changing/Adding sounds? (DoD TK Revenge)


blobby
07-21-2007, 11:56 AM
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 full

Regards

Blobby

p.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
07-21-2007, 06:56 PM
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 full

Regards

Blobby

p.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??

1. you can change/remove the sound with those lines:
client_cmd(param[0],"spk Gman/Gman_Choose1")
and
client_cmd(param[0],"spk Gman/Gman_Choose2")

2. that would be possible for sure, look for this code:
client_print(0,print_chat, "[DoD TK Revenge] %L",LANG_PLAYER,"SLAPANDFORGIVE",victimname,killername)
user_slap(teamkiller[id],0)

and add a line after user_slap(teamkiller[id],0) containing:
emit_sound(teamkiller[id], CHAN_AUTO, "YOURSOUNDHERE.WAV", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

hope that helps a bit :cool:


Well well, looking through the code i realized that i used a big bunch of duplicate code,
so i'll optimize that for a new version.

blobby
07-22-2007, 10:16 AM
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**

but if you could help me be able to use my own custom sounds i would be very great full

Regards

Blobby

FeuerSturm
07-22-2007, 01:45 PM
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**

but if you could help me be able to use my own custom sounds i would be very great full

Regards

Blobby

yes, that is wrong indeed, place your soundfiles in "/dod/sound/misc/"

an example would be "howstupid.wav", so upload that sound into the
above folder.

- the sound has to be precached so clients will download it, to do so
add to the sma:
public plugin_precache()
{
if(file_exists("sound/misc/howstupid.wav"))
{
precache_sound("misc/howstupid.wav")
}
}

- now the sound has to be played in game:
client_cmd(param[0],"spk misc/howstupid")

NOTE: that example is formated to replace the sound that is played when
the menu pops up!

blobby
07-22-2007, 01:59 PM
So does it matter where on the sma i add this

public plugin_precache()
{
if(file_exists("sound/misc/howstupid.wav"))
{
precache_sound("misc/howstupid.wav")
}
}

And 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 to

Regards

Blobby

P.s I only keep asking loads of questions because i don't want to get it wrong and mess up my server lol

FeuerSturm
07-22-2007, 02:10 PM
the precache function already exists, you will just have to change it from:
public plugin_precache()
{
killerburn = precache_model("sprites/explode1.spr")
}

to

public plugin_precache()
{
killerburn = precache_model("sprites/explode1.spr")
precache_sound("misc/howstupid.wav")
}


You can change what the menu says in the language file, just change
MENUFORGIVE = Forgive! in dod_tkrevenge.txt
to for example:
MENUFORGIVE = Bitchslap!

blobby
07-22-2007, 04:34 PM
Ok so every where in the code i saw this

client_print(0,print_chat, "[DoD TK Revenge] %L",LANG_PLAYER,"SLAPANDFORGIVE",victimname,killername)
user_slap(teamkiller[id],0)
emit_sound(teamkiller[id], CHAN_AUTO, "bitchslap.WAV", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

i added the sound line below every line like that is that correct

and the sound dl i did this

public plugin_precache()
{
killerburn = precache_model("sprites/explode1.spr")
precache_sound("misc/bitchslap.wav")

Is 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 correct

Regards

Blobby

P.S Thankyou m8 for all the time you have given me for help with this

FeuerSturm
07-22-2007, 04:50 PM
almost correct, just a little correction:

emit_sound(teamkiller[id], CHAN_AUTO, "misc/bitchslap.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

the misc/ is important, other than that it's correct.

blobby
07-23-2007, 08:25 AM
Wiked cheers buddy wow you have no idea how much your help is appreciated thanks so much buddy

Regards

Blobby