General > Developers Corner

ULX Get User Group

(1/1)

hymsan:
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

JamminR:
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.

Aaron113:
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

hymsan:
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.

JamminR:
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 -

--- Code: --- elseif ply:IsAdmin() or ply:IsSuperAdmin() then

--- End code ---

Change to

--- Code: --- elseif ply:IsAdmin() or ply:IsSuperAdmin() or ply:IsUserGroup("protected") then

--- End code ---

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.

Navigation

[0] Message Index

Go to full version