Ulysses
General => Developers Corner => Topic started by: LightSiderDelta on February 17, 2016, 07:57:38 PM
-
I was wondering if it is possible to be in multiple ULX groups at the same time, and how I would do so if possible.
-
Nope.
EDIT: Well... maybe. But what would you need it for?
-
Nope.
EDIT: Well... maybe. But what would you need it for?
I need to make it so Staff can be whitelisted to a specific job in darkrp, while also still being staff. I can't give that job inherent rights from a staff group because normal people also use the job.
Basically any way admins can be in a darkrp job that requires being whitelisted, while also having staff powers, is what I need. If you haven't guessed, this is for a star wars rp server. On a server I used to play, T-mod and up had access to every single job without having to be whitelisted to the group, by people still had to. This is also another thing that would work if anyone knows how to do that.
-
Unfortunately, ULX does not have any native support for what you are requesting (unless you configured each possible combination of groups and jobs manually, but that would be a nightmare). We are investigating more flexible solutions (especially regarding teams) for ULX4 in the future, but I wouldn't expect it to be available for a while.
For now, you could custom code a solution that gives individual users access (using "ulx userallow") to the commands they need when they join a team, then use "ulx userdeny <command> 1" to remove their individual access when they leave the team, join a new team, and probably when they leave the server as well.
-
Don't DarkRP jobs have a CustomCheck function for whitelisting? Or are you not using that?
-
Don't DarkRP jobs have a CustomCheck function for whitelisting? Or are you not using that?
I tried using custom check, this is what I did for that the other day
I was making class "Clone Trooper" The individual whitelisting worked for it, but admins didnt have access because they were were in the admin group
customCheck = function(ply) return ply:GetNWString("usergroup") == "Clone Trooper" and customCheck = function(ply) return ply:GetNWString("usergroup") == "owner" end,
CustomCheckFailMsg = "This job is donator only."
I didn't just have owner there either, I put an and after that and put every admin group, then an end. I just put owner there for the sake of the forum.
I also tried putting a comma after the end, not using a comma after end, etc. On my server it said it was expecting the read "end" before "=". I have no idea what it's trying to say, and I have tried many variations of this code.
-
A flexible way to do this would be to have your job check for a specific permission sting. That was you can assign that permission string to any group(s) or people that you want to have access.
-
-snip-
customCheck = function(ply) return ply:GetNWString("usergroup") == "Clone Trooper" and customCheck = function(ply) return ply:GetNWString("usergroup") == "owner" end,
CustomCheckFailMsg = "This job is donator only."
There's a major flaw in your code there.
customCheck = function(ply) --[[ ... ]]-- and customCheck = function(ply) --[[ ... ]]-- end
While this makes sense grammatically, this is invalid in Lua's syntax.
You should instead write something like:
customCheck = function(ply)
return ply:GetUserGroup() == "Storm Trooper" or ply:GetUserGroup() == "owner"
end
This assumes, of course, that you want inheritance to be negligible, and ONLY the groups Storm Trooper and owner should be able to take this job.
The long-winded explanation is that, in Lua, a variable cannot contain two values like you seem to want it to have there. Instead, variables (or fields, like customCheck) may only have one value (or in this case, may only be one function). You tried to assign two functions to one variable and, moreover, forgot to close the initial function before moving on to the next.
I would recommend doing some reading on the Lua programming language. It's actually not too hard to get into, and would help you immensely in working with servers.
-
Okay, Thanks everyone who helped!
-
A flexible way to do this would be to have your job check for a specific permission sting. That was you can assign that permission string to any group(s) or people that you want to have access.
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.
-
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.
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
-
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
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.
-
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")
-
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")
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!"
-
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!"
-
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!"
You sir, are a god among men. Tried and true.