Ulysses
General => Developers Corner => Topic started by: [NNJG]Ben on February 02, 2010, 07:14:10 PM
-
Hello,
I created a ULX group called "donatorplus" and I want to enable ravebreak for them. My rave file is in /garrysmod/lua and I want to know how I can change it to work.
Current code is this, which I am told I should change.
function RaveCommand( pl, cmd, args )
if pl:IsAdmin() then
if not Raving then
RaveBreak()
else
pl:ChatPrint("You're already raving dude!")
end
-
Ben,
Easiest way of modifying the code you have now (if it's working for admins) would be to change
if pl:IsAdmin() then
to
if pl:IsAdmin() or pl:IsUserGroup("donatorplus") then
Beware though, any group that inherits donatorplus in your groups file will have access.
See Player.IsUserGroup (http://wiki.garrysmod.com/favicon.ico) (http://wiki.garrysmod.com/?title=Player.IsUserGroup)
-
Beware though, any group that inherits donatorplus in your groups file will have access.
That only applies to ply:CheckGroup -- http://ulyssesmod.net/docs/files/lua/ULib/shared/sh_ucl-lua.html#Player:CheckGroup (er, in SVN anyways)
-
Megiddo, in ULib release(non-svn), didn't we overwrite/enhance IsUserGroup to see inherited groups?
I thought we had some complaints because of that and hence why we made Checkgroup.
Superadmin inherits admin inherits operator inherits user. If testing Admin, wouldn't a Superadmin be considered an Admin?
-
Megiddo, in ULib release(non-svn), didn't we overwrite/enhance IsUserGroup to see inherited groups?
I thought we had some complaints because of that and hence why we made Checkgroup.
Superadmin inherits admin inherits operator inherits user. If testing Admin, wouldn't a Superadmin be considered an Admin?
That's right, I had forgotten that this was the case in release when I made the post. (rats on me for not checking the revision history in the docs)