Ulysses

General => Developers Corner => Topic started by: Sophersky on August 17, 2014, 06:50:05 PM

Title: Setting a sound for player death?
Post by: Sophersky on August 17, 2014, 06:50:05 PM
On my server I have a ranking system based upon HL2, and I would like to know if there was a way to set a sound to be made upon a player's death, and if it would be possible to do different sounds for each group. For example, people in the metro cop group make a metro cop's death sound, while people in the Combine Soldier group make a Combine Soldier's death sound.
Title: Re: Setting a sound for player death?
Post by: JamminR on August 17, 2014, 09:41:27 PM
Are you wanting all your code work done for you?
Or are you wanting to learn yourself how to do this?

If yourself, you'd need to use the PlayerDeath hook, Team? function, (I've no idea how the gamemode you're using defines "groups"), and sound function..
Playerdeath (http://wiki.garrysmod.com/page/GM/PlayerDeath)
Team (http://wiki.garrysmod.com/page/Player/Team)
Sound (there's several Sound play options, client based, and world entity based...figure out which one you want and use it)


Title: Re: Setting a sound for player death?
Post by: Sophersky on August 18, 2014, 02:15:35 PM
The gamemode is normal sandbox, basically the staff ranking system goes Metro Cop (moderator), Combine Soldier (Admin), Shotgun Soldier (Superadmin) and Combine Elite, which is the owner rank. Basically the ranks are normal ULX groups, but they have their own UTeam teams as well and I could add the sounds for the teams.

And yes, I do wish to learn how to do it myself.
Title: Re: Setting a sound for player death?
Post by: ChaosWolf on August 21, 2014, 05:25:58 PM
saw this and was reminded of an addon in steam with this function, usually when players die you hear the lifeline sound,

go into steam look for an addon called sadviolindeath extract it, then replace the soundfile with your custom file and change the sadviolin.wav with your exampledeath.wav in the lua file. place it in garrysmod>addons restart the server and your done.
Title: Re: Setting a sound for player death?
Post by: Sophersky on August 24, 2014, 11:33:03 AM
saw this and was reminded of an addon in steam with this function, usually when players die you hear the lifeline sound,

go into steam look for an addon called sadviolindeath extract it, then replace the soundfile with your custom file and change the sadviolin.wav with your exampledeath.wav in the lua file. place it in garrysmod>addons restart the server and your done.

How would you set different sounds for different ULX groups?
Title: Re: Setting a sound for player death?
Post by: ChaosWolf on August 24, 2014, 12:58:51 PM
The sound reads from a file you create in the sound>advjl folder and the sounds you put in it. all you have to do is set the group, set the join message, and the sound file you want it to play when someone from that user group has arrived. ive had a little trouble with it myself but nothing major, sounds are always a pain in the @$$ for me. I will go get a link and update this post with it. standby...

here it is, I think this is exactly what your looking for.

http://forums.ulyssesmod.net/index.php/topic,7367.msg37686.html#msg37686 (http://forums.ulyssesmod.net/index.php/topic,7367.msg37686.html#msg37686)