Author Topic: ULX Get User Group  (Read 22700 times)

0 Members and 1 Guest are viewing this topic.

Offline hymsan

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
ULX Get User Group
« 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

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Get User Group
« Reply #1 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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: ULX Get User Group
« Reply #2 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


Offline hymsan

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: ULX Get User Group
« Reply #3 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.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Get User Group
« Reply #4 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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming