ULX

Author Topic: Get group of SteamID  (Read 2966 times)

0 Members and 1 Guest are viewing this topic.

Offline BigBrainAFK

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Get group of SteamID
« on: April 25, 2015, 01:06:57 PM »
Hello,

I have recently scripted some things and now I kind off ran into some problems.
I have to figure out how I can check if a SteamID is in a specific user group.

Is there an ULX or UCL function for this?


//EDIT: I also noticed that every group that has banid or kickid rights is able to ban everyone including people from groups they normally can't target.
« Last Edit: April 25, 2015, 01:15:21 PM by BigBrainAFK »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Get group of SteamID
« Reply #1 on: April 25, 2015, 01:40:33 PM »
Could use ULib's getPlyByID
http://ulyssesmod.net/docs/files/lua/ulib/shared/player-lua.html#getPlyByID

and then GetUserGroup or CheckGroup the ply object.
http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#Player:GetUserGroup

As for can_target, I don't remember well enough to know if that is by design or something not actually right.
It doesn't sound right, and is likely you have a group inheritance branch issue somewhere.
That question would fit best in another thread.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline BigBrainAFK

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Get group of SteamID
« Reply #2 on: April 25, 2015, 01:55:19 PM »
thx for the quick help and I will definitely open a new thread for the banid / kickid thing cause I checked all can target field nothing wrong there. I also would like to know how inheritance could be the issue of the banid /kickid thing.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Get group of SteamID
« Reply #3 on: April 25, 2015, 05:29:42 PM »
I'm going to work on this. I'll post once I have an update for you.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given