ULX

Author Topic: Get all users in a group  (Read 2783 times)

0 Members and 2 Guests are viewing this topic.

Offline iitiago

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Get all users in a group
« on: September 30, 2019, 09:55:52 AM »
How would I get all users in a group alongside their steamid? I thought about using getUsers() but have no clue how to use this function.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Get all users in a group
« Reply #1 on: September 30, 2019, 07:29:08 PM »
Ulib.ucl stores all info. There's a Ulib.ucl.groups that stores other table info, including I think, members.
As for how to use ULib commands, don't forget we have docs.
https://ulyssesmod.net/docs/files/lua/ulib/shared/player-lua.html#getUsers


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline iitiago

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Get all users in a group
« Reply #2 on: October 01, 2019, 10:25:54 AM »
Ulib.ucl stores all info. There's a Ulib.ucl.groups that stores other table info, including I think, members.
As for how to use ULib commands, don't forget we have docs.
https://ulyssesmod.net/docs/files/lua/ulib/shared/player-lua.html#getUsers




Ah ok and I read the docs to find getUsers but didnt understand the args required. Ive been looking for the Ulib.ucl.groups in the docs and can't find it. Can you point me in the right direction please?
« Last Edit: October 01, 2019, 12:11:12 PM by iitiago »

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Get all users in a group
« Reply #3 on: October 01, 2019, 12:45:31 PM »
Stickly Man! posted some example code on how to use the data in ULib.ucl.users to get all members of a certain group in Topic: Listing group members.

ULib.getUsers only works on online players. It can be used to get all active players in a certain group. Bytewave posted some examples in Topic: ULib.getUsers help.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Get all users in a group
« Reply #4 on: October 01, 2019, 08:15:12 PM »
UCL - It's a table. It stores all user/group info - (U)lib Access (C)ontrol (L)ist
https://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html


Thanks for the assist Timmy. It was late and i totally forgot .users. Thought there might actually be users in .groups


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline iitiago

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Get all users in a group
« Reply #5 on: October 02, 2019, 08:26:07 AM »
Stickly Man! posted some example code on how to use the data in ULib.ucl.users to get all members of a certain group in Topic: Listing group members.

ULib.getUsers only works on online players. It can be used to get all active players in a certain group. Bytewave posted some examples in Topic: ULib.getUsers help.

UCL - It's a table. It stores all user/group info - (U)lib Access (C)ontrol (L)ist
https://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html

Thank you guys soo much :D

Thanks for the assist Timmy. It was late and i totally forgot .users. Thought there might actually be users in .groups