General > Developers Corner

Want a rank with No mic/talk Privalleges!

(1/1)

awesomenessispure:
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!

Avoid:
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!

awesomenessispure:
How do i move this!

Matryan:
When you say class, I'm assuming you mean ULX group/rank.
this should work, chuck it in lua/autorun.


--- Code: ---hook.Add("PlayerCanHearPlayersVoice", "stopannoyingmicspammersandsqueakers", function(listener, talker)

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

          return false

     else

          return true

     end

end

--- End code ---

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

Decicus:

--- Quote from: Matryan 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: ---hook.Add("PlayerCanHearPlayersVoice", "stopannoyingmicspammersandsqueakers", function(listener, talker)

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

          return false

     else

          return true

     end

end

--- End code ---

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.

--- End quote ---

This would just throw an error. You would need to change the third line to:

--- Code: ---if ( talker:GetUserGroup() == "RANK" ) then
--- End code ---

or you could use IsUserGroup instead:

--- Code: ---if ( talker:IsUserGroup( "RANK" ) ) then
--- End code ---

Navigation

[0] Message Index

Go to full version