Ulysses
General => Developers Corner => Topic started by: nofear1999 on September 14, 2009, 09:33:56 AM
-
does ULX Admin user groups function ply:IsUserGroup("group")
so ex. you can create a group called respected and
if ply:IsUserGroup("respected") then
code goes here
end
-
I have no idea what you're talking about.
-
Ummm,
I was buzzed when I posted that.
Okay, ULX has function ulx addgroup
Does that function allow
function respectedcheck
if ply:IsUserGroup("respected") then
ply:Give("phygun")
ply:Give("toolgun")
end
concommand.Add("respected", respectedcheck)
-
IsUserGroup() is a garry function. It returns true if the user belongs to the group, yes. You might be looking for CheckGroup() though (see docs).
-
I couldn'tfind CheckGroup in the Document.
Could you please link me?
-
http://ulyssesmod.net/docs/files/lua/ULib/shared/sh_ucl-lua.html#Player:CheckGroup
-
so
if ply:CheckGroup() == "Respected" then
ply:Give( "physgun" )
ply:Give( "physgun" )
end
-
so
if ply:CheckGroup() == "Respected" then
ply:Give( "physgun" )
ply:Give( "physgun" )
end
No. Pay attention to the docs. CheckGroup returns a bool and takes a parameter.
-
I'm not experianced with Booleans yet,
Could you explain? I don't see any formats on the Documentation.
if ply:CheckGroup() "Respected" == 1 then
ply:Give( "physgun" )
ply:Give( "toolgun" )
end
-
This isn't the right place to start learning lua. Look to http://lua.org/pil and the garrysmod wiki until you got off your feet.
-
I have, could you please explain the format to me?
I look @ Gmod wiki alot, i've gone through EVERY tutorial.
Please, explain it to me. :/l
-
CheckGroup("group")
-
so
if ply:CheckGroup("respected") then
ply:Give("gmod_tool")
ply:Give("Physgun")
end
or
if CheckGroup("respected") then
ply:Give("gmod_tool")
ply:Give("Physgun")
end
-
Your first example should work.
Boolean basically means true or false.
Be careful though. CheckGroup will see inherited groups and return true.
For example, if admin inherits respected in the ULib UCL chain... admin's would get returned as true also.
If you only want the respected group to have something, then GetUserGroup is your best bet, and for that you would then use the example you showed already "if ply:GetUserGroup() == "respected" then"
-
Thank you jamminR, i just went in like that and added or == ("admin") or ("superadmin") then