Ulysses

General => Developers Corner => Topic started by: eric1555 on February 21, 2011, 07:53:53 AM

Title: ply:IsDonator?
Post by: eric1555 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()
Title: Re: ply:IsDonator?
Post by: Stickly Man! 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
Title: Re: ply:IsDonator?
Post by: Megiddo 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.
Title: Re: ply:IsDonator?
Post by: MrPresident 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..
Title: Re: ply:IsDonator?
Post by: JamminR 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