ULX

Author Topic: ply:IsDonator?  (Read 3181 times)

0 Members and 1 Guest are viewing this topic.

Offline eric1555

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
ply:IsDonator?
« on: February 21, 2011, 07:53:53 AM »
When I have custom groups like "donator" how would I define them, like ply:IsSuperAdmin()?
Would it be   "ply:Isdonator()" or ply:IsUserGroupdonator()

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: ply:IsDonator?
« Reply #1 on: February 21, 2011, 09:36:41 AM »
If my memory isn't failing me, you should be doing this:

if ( ply:GetUserGroup() == "donator" ) then
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ply:IsDonator?
« Reply #2 on: February 21, 2011, 10:37:37 AM »
Stickly Man is correct, the Is*Admin() functions are provided for convenience, ply:GetUserGroup() == "*admin" is the same thing.
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: ply:IsDonator?
« Reply #3 on: February 21, 2011, 03:55:33 PM »
ply:IsUserGroup("donator")


^works too.. and is cleaner than ply:GetUserGroup() == "donator" IMO.



edit... but I think that requres ULib be installed... hmm.. <3 ULib..
« Last Edit: February 21, 2011, 03:57:09 PM by MrPresident »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ply:IsDonator?
« Reply #4 on: February 21, 2011, 05:23:16 PM »
GetUserGroup is actually a 'ULib only' function, so, yeah, IsUserGroup is your standard "no ULib needed but just isn't as cool as hanging out with cool kids" code.
http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#Player:GetUserGroup
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming