ULX

Author Topic: Want a rank with No mic/talk Privalleges!  (Read 2371 times)

0 Members and 1 Guest are viewing this topic.

Offline awesomenessispure

  • Newbie
  • *
  • Posts: 9
  • Karma: -7
Want a rank with No mic/talk Privalleges!
« on: September 13, 2014, 11:52:10 AM »
How do i make a class where i can restrict mic! I want a class where i can add all the Annoying spammers and Squeakers to!
« Last Edit: September 13, 2014, 12:28:56 PM by awesomenessispure »

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Want a rank with No mic/talk Privalleges!
« Reply #1 on: September 13, 2014, 12:23:48 PM »
Hello,
this does not belong here, would probably be better to move it into the developers discussion.
Take a look at this.

Also, thank you for detailed explanation!

Offline awesomenessispure

  • Newbie
  • *
  • Posts: 9
  • Karma: -7
Re: Want a rank with No mic/talk Privalleges!
« Reply #2 on: September 13, 2014, 12:28:13 PM »
How do i move this!

Offline Matryan

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Want a rank with No mic/talk Privalleges!
« Reply #3 on: September 20, 2014, 09:04:35 AM »
When you say class, I'm assuming you mean ULX group/rank.
this should work, chuck it in lua/autorun.

Code: [Select]
hook.Add("PlayerCanHearPlayersVoice", "stopannoyingmicspammersandsqueakers", function(listener, talker)

     if ( talker:GetUserGroup() == "RANK" ) then

          return false

     else

          return true

     end

end

Whilst in game, create a new rank in ULX, call it what ever you want.
Then rename RANK in the code to that new ULX rank.

This may work.

EDIT:
Oops. forgot parentheses
« Last Edit: September 21, 2014, 05:35:36 AM by Matryan »

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Want a rank with No mic/talk Privalleges!
« Reply #4 on: September 20, 2014, 01:20:51 PM »
When you say class, I'm assuming you mean ULX group/rank.
this should work, chuck it in lua/autorun.

Code: [Select]
hook.Add("PlayerCanHearPlayersVoice", "stopannoyingmicspammersandsqueakers", function(listener, talker)

     if ( talker:GetUserGroup == "RANK" ) then

          return false

     else

          return true

     end

end

Whilst in game, create a new rank in ULX, call it what ever you want.
Then rename RANK in the code to that new ULX rank.

This should work.

This would just throw an error. You would need to change the third line to:
Code: [Select]
if ( talker:GetUserGroup() == "RANK" ) then
or you could use IsUserGroup instead:
Code: [Select]
if ( talker:IsUserGroup( "RANK" ) ) then
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.