ULX

Author Topic: Function to return list of groups?  (Read 2012 times)

0 Members and 1 Guest are viewing this topic.

Offline Ludicium

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Function to return list of groups?
« on: December 03, 2012, 02:38:43 PM »
I am writing a script and I need to be able to get all the groups on a server from ulx, any thoughts? I already took a look at the ulib documentation and I didn't see anything but then again I didn't look very hard.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Function to return list of groups?
« Reply #1 on: December 03, 2012, 02:58:16 PM »
The groups are stored in this table:

ULib.ucl.groups

if you were do do something like...

for k, v in pairs(ULib.ucl.groups) do
     print(k)
end

it would return a list of all the groups.

Offline Ludicium

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Function to return list of groups?
« Reply #2 on: December 03, 2012, 03:39:14 PM »
So the index is the group name. I see thanks :).