ULX

Author Topic: Is it possible to be in multiple ULX groups at the same time?  (Read 8278 times)

0 Members and 4 Guests are viewing this topic.

Offline LightSiderDelta

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Is it possible to be in multiple ULX groups at the same time?
« 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.

Offline feldma

  • Newbie
  • *
  • Posts: 47
  • Karma: 5
  • 5696 hours in Gmod and counting!
    • Mega-Strike Network
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #1 on: February 17, 2016, 09:55:40 PM »
Nope.

EDIT: Well... maybe. But what would you need it for?
Solving 50% of people's questions by searching it up on google.

Trying to think of a cool idea to code, so I can inspire myself to code. If you want something done, please message me!

Offline LightSiderDelta

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #2 on: February 18, 2016, 05:17:45 AM »
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.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #3 on: February 18, 2016, 08:36:29 AM »
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.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #4 on: February 18, 2016, 11:33:12 AM »
Don't DarkRP jobs have a CustomCheck function for whitelisting? Or are you not using that?
bw81@ulysses-forums ~ % whoami
Homepage

Offline LightSiderDelta

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #5 on: February 18, 2016, 12:23:09 PM »
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.
« Last Edit: February 18, 2016, 12:25:39 PM by LightSiderDelta »

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #6 on: February 18, 2016, 12:43:29 PM »
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.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #7 on: February 18, 2016, 04:57:19 PM »
-snip-
Code: [Select]
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.

Code: [Select]
customCheck = function(ply) --[[ ... ]]-- and customCheck = function(ply) --[[ ... ]]-- endWhile this makes sense grammatically, this is invalid in Lua's syntax.
You should instead write something like:
Code: [Select]
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.
bw81@ulysses-forums ~ % whoami
Homepage

Offline LightSiderDelta

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #8 on: February 18, 2016, 09:26:50 PM »
Okay, Thanks everyone who helped!

Offline Ihremutter

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #9 on: March 30, 2018, 09:13:53 PM »
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.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #10 on: March 30, 2018, 10:50:40 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.
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
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Ihremutter

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #11 on: March 31, 2018, 12:58:41 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

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.
« Last Edit: March 31, 2018, 01:04:33 PM by Ihremutter »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #12 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")
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Ihremutter

  • Newbie
  • *
  • Posts: 4
  • Karma: 1
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #13 on: April 01, 2018, 02:58:53 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")

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!"

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Is it possible to be in multiple ULX groups at the same time?
« Reply #14 on: April 01, 2018, 06:52:30 PM »
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!"
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming