General > Developers Corner

Rave

(1/1)

[NNJG]Ben:
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.

--- Code: --- function RaveCommand( pl, cmd, args )
if pl:IsAdmin() then
if not Raving then
RaveBreak()
else
pl:ChatPrint("You're already raving dude!")
end
--- End code ---

JamminR:
Ben,
Easiest way of modifying the code you have now (if it's working for admins) would be to change

--- Code: ---   if pl:IsAdmin() then

--- End code ---
to

--- Code: ---   if pl:IsAdmin() or pl:IsUserGroup("donatorplus") then

--- End code ---
Beware though, any group that inherits donatorplus in your groups file will have access.

See Player.IsUserGroup

Megiddo:

--- Quote from: JamminR on February 02, 2010, 09:02:11 PM ---Beware though, any group that inherits donatorplus in your groups file will have access.

--- End quote ---

That only applies to ply:CheckGroup -- http://ulyssesmod.net/docs/files/lua/ULib/shared/sh_ucl-lua.html#Player:CheckGroup (er, in SVN anyways)

JamminR:
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:

--- Quote from: JamminR on February 03, 2010, 03:27:57 PM ---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?

--- End quote ---

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)

Navigation

[0] Message Index

Go to full version