Ulysses
General => Developers Corner => Topic started 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!
-
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!
-
How do i move this!
-
When you say class, I'm assuming you mean ULX group/rank.
this should work, chuck it in lua/autorun.
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
-
When you say class, I'm assuming you mean ULX group/rank.
this should work, chuck it in lua/autorun.
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:
if ( talker:GetUserGroup() == "RANK" ) then
or you could use IsUserGroup (http://wiki.garrysmod.com/page/Player/IsUserGroup) instead:
if ( talker:IsUserGroup( "RANK" ) ) then