Ulysses
General => Developers Corner => Topic started by: hymsan on March 20, 2011, 08:53:16 AM
-
Hello everyone,
I'm having a little issue detecting ULX groups with lua, I've tried:
http://wiki.garrysmod.com/?title=Player.IsUserGroup
But it doesn't seem to detect, basically I need to do, if ply.IsUserGroup("protected") then etc. but it's not detecting the group when I go in game, am I using this function wrong? Is there another way to do it?
Thanks in advance!
Rokrox
-
It would really help us to see what code example you are using to test before we can determine how correct it is.
However, without knowing much, if you have a user that is in a group called "protected", that test should result to true with that lua check.
-
Ok, I spotted your problem.
if ply.IsUserGroup("protected") then --- You do not use a dot(.), you use a colon(:).
if ply:IsUserGroup("protected") then
-
Hey, sorry about not being specific, basically I'm trying to make it so Uclip allows people in the group "protected" to use uclip, I can't find a good way to pull the ulx group, the ply:IsUserGroup doesn't work.
-
If using ulx, grant your protected group "ulx noclip" access.
If not, and you simply have a protected group in your gmod/settings/users.txt
Uclip 1.2, line 31 of sh_uclip.lua
Old -
elseif ply:IsAdmin() or ply:IsSuperAdmin() then
Change to
elseif ply:IsAdmin() or ply:IsSuperAdmin() or ply:IsUserGroup("protected") then
If you're not using ULib, and that line isn't working for you, then whatever you are using isn't using normal Gmod group checking.
If you are using ULib/ulx, and that doesn't work for you, please return to us with a "ulx debuginfo" file attached to your next post, run from the server console while a protected group player is connected to the server.