ULX

Author Topic: Dead Mute  (Read 2669 times)

0 Members and 1 Guest are viewing this topic.

Offline soccercrazy195

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Dead Mute
« on: January 28, 2010, 06:00:36 PM »
Can we please have an automute(Players get muted when they die) mod?

Offline vader0146

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 9
Re: Dead Mute
« Reply #1 on: February 09, 2010, 06:43:27 AM »
hook.Add("PlayerSay", "MuteWhenDead", function( ply )
   if !ply:Alive() then
      return false
   end
end )

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Dead Mute
« Reply #2 on: February 09, 2010, 03:50:17 PM »
PlayerSay is a tricky hook.
So many scripts rely on it, but returning anything breaks the PlayerSay hook for all other scripts (if I remember correctly).
Including ULX chat commands.

Using a clientside Gamemode.OnPlayerChat would probably be better for not breaking an entire server hook system.
« Last Edit: February 09, 2010, 03:53:34 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given