Ulysses

General => Developers Corner => Topic started by: hymsan on March 20, 2011, 08:53:16 AM

Title: ULX Get User Group
Post 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
Title: Re: ULX Get User Group
Post by: JamminR on March 20, 2011, 10:27:00 AM
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.
Title: Re: ULX Get User Group
Post by: Aaron113 on March 20, 2011, 11:01:43 AM
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

Title: Re: ULX Get User Group
Post by: hymsan on March 27, 2011, 02:27:48 PM
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.
Title: Re: ULX Get User Group
Post by: JamminR on March 27, 2011, 03:35:59 PM
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: [Select]
elseif ply:IsAdmin() or ply:IsSuperAdmin() then

Change to
Code: [Select]
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.