General > Developers Corner

Is it possible to be in multiple ULX groups at the same time?

<< < (3/4) > >>

JamminR:

--- Quote from: Ihremutter on March 30, 2018, 09:13:53 PM ---I hate to resurrect the dead but can anyone possibly tell me how to run a check like this? If I can just assign my "SMODs" the "Bronze" permission, then all would be solved with this issue.

--- End quote ---
No clue how jobs work, and, Bronze sounds like a group, not a permission string.
Permission string would be like, in ULX, "ulx slap", and you'd use ULib's ucl.query
http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query

Ihremutter:

--- Quote from: JamminR on March 30, 2018, 10:50:40 PM ---No clue how jobs work, and, Bronze sounds like a group, not a permission string.
Permission string would be like, in ULX, "ulx slap", and you'd use ULib's ucl.query
http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query

--- End quote ---

Well in my thought process a text string is a text string regardless of weather it is an actual command or not. If I assigned the text string "bronze" as a "permission"(Not sure if that'd work like a text tag?) then have the command check for the presence  of said text string, think that'd work? I'm only curious because the UCL* page says:

"access   The access string to check for.  (IE “ulx slap”, doesn’t have to be a command though).  If nil is passed in, this always returns true."

I'm far more comfortable with Excel formula's than PHP or LUA but this sounds like a standard IF(TEXT=TEXT,1,0) check to me.

JamminR:
It is indeed a text string. I just wanted to make sure you weren't confusing a "group" name with a access string.
(Though there's no rule saying you couldn't give a Bronze group a text string permission called "bronze")

Ihremutter:

--- Quote from: JamminR on March 31, 2018, 07:13:41 PM ---It is indeed a text string. I just wanted to make sure you weren't confusing a "group" name with a access string.
(Though there's no rule saying you couldn't give a Bronze group a text string permission called "bronze")

--- End quote ---

Cool ok, so I can potentially give them the "bronze" permission I assume using the "ulx userallow NAME bronze"; however, how would I go about doing a customCheck similar to the below, but on the ULC permission strings instead of the group name?

    customCheck = function(ply) return ply:GetUserGroup() == "bronze" end,
    CustomCheckFailMsg = "You must be Tier 1(Bronze) or higher to join this job!"

JamminR:
Never used DarkRP or coded for it, but this should work. You could change that fail message to whatever you wanted it to say.
"You must have bronze access...blah blah"

 customCheck = function(ply) return ULib.ucl.query(ply, "bronze") end,
 CustomCheckFailMsg = "You must be Tier 1(Bronze) or higher to join this job!"

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version