Ulysses

General => Developers Corner => Topic started by: awesomenessispure on September 13, 2014, 11:52:10 AM

Title: Want a rank with No mic/talk Privalleges!
Post by: awesomenessispure 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!
Title: Re: Want a rank with No mic/talk Privalleges!
Post by: Avoid 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 (https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1bc4.html).

Also, thank you for detailed explanation!
Title: Re: Want a rank with No mic/talk Privalleges!
Post by: awesomenessispure on September 13, 2014, 12:28:13 PM
How do i move this!
Title: Re: Want a rank with No mic/talk Privalleges!
Post by: 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: [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
Title: Re: Want a rank with No mic/talk Privalleges!
Post by: Decicus 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 (http://wiki.garrysmod.com/page/Player/IsUserGroup) instead:
Code: [Select]
if ( talker:IsUserGroup( "RANK" ) ) then