Author Topic: Setting a sound for player death?  (Read 2388 times)

0 Members and 1 Guest are viewing this topic.

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Setting a sound for player death?
« 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.
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting a sound for player death?
« Reply #1 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
Team
Sound (there's several Sound play options, client based, and world entity based...figure out which one you want and use it)


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Re: Setting a sound for player death?
« Reply #2 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.
« Last Edit: August 18, 2014, 02:20:25 PM by Sophersky »
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Setting a sound for player death?
« Reply #3 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.
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Re: Setting a sound for player death?
« Reply #4 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?
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Setting a sound for player death?
« Reply #5 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
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer