ULX

Author Topic: [Help wanted] Restricting command arguments  (Read 6698 times)

0 Members and 1 Guest are viewing this topic.

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
[Help wanted] Restricting command arguments
« on: February 10, 2013, 11:59:29 AM »
Hi all! First post on the forum  :)
Im running ULX on my TTT server, and I love it.
However, all admins keep slaying all the survivors at the end of the round by using the "!slay *" command "for the lulz".
Not a big issue, but i think it is silly, and want to remove the abillity to slay all, admin and superadmin from the group "admin".

Ive tried typing in !%*, and !* in the "restrict command arguments" section of the slay command, but nothing happens.

Can someone give me a quick tutorial on how this works, and what I need to type in to acomplish what I want?

A picture of what I've tried so far.



Any help is very welcome!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Help wanted] Restricting command arguments
« Reply #1 on: February 10, 2013, 12:20:35 PM »
No, you didn't use % in what you typed in XGUI.
You used $. :)
Try %, which is what our can_target looks for when specifying groups.
Additionally, I'm pretty sure 'ignore can_target' DISABLES that for the group(s) you have selected.
So, you definitely wouldn't want that for the groups you're trying to restrict.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #2 on: February 10, 2013, 01:02:11 PM »
I did try to use !%*, but I dont believe it worked.
Im a little confused about the "ignore can_target" function.
I had the feeling that it meant to disable the default given target rights for all commands, or am I wrong?

But anyway, should I then write i ex;
%user,%regular
In the xgui? Meaning they can only target the group "user" and "regular"?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Help wanted] Restricting command arguments
« Reply #3 on: February 10, 2013, 07:22:17 PM »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #4 on: February 11, 2013, 12:14:14 AM »
Thank you for that link. Been looking for something like that!

So, I should rather use console then?
So if I want admins to only be able to slay regulars, guests and themselfs I could do something like this?

Code: [Select]
ulx groupallow admin "ulx slay" "!%moderator,^"

In that case, would this also remove the ability to slay "all" (!slay *) ?
« Last Edit: February 11, 2013, 12:18:24 AM by zaph »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Help wanted] Restricting command arguments
« Reply #5 on: February 11, 2013, 02:01:45 PM »
You can still use our menu, that article just covers how the groupings work.
If you don't specify !*, they'll still be able to slay all.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #6 on: February 11, 2013, 02:10:00 PM »
Well, this is what ive used.

rcon ulx groupallow admin "ulx slay" "!%moderator,!*,^"

and i can still slay all as an admin (!slay *)
« Last Edit: February 11, 2013, 02:15:03 PM by zaph »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Help wanted] Restricting command arguments
« Reply #7 on: February 11, 2013, 02:23:41 PM »
Are you an admin, or a superadmin? Most server owners are superadmin.
And, as I questioned before but am not sure, do you still have that 'ignore can_target' set on admins?
From what logical perspective I have, that would mean 'allow access to this team to override the target settings'

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #8 on: February 11, 2013, 02:33:51 PM »
I am a superadmin, but i set myself to admin whenever i test this. And no, i unchecked the "ignore can_target" box.

Im trying to make it so that admins can only slay people in the usergroups "user" and "regular", and themselves

« Last Edit: February 11, 2013, 02:41:06 PM by zaph »

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #9 on: February 14, 2013, 10:11:12 AM »
Anyone? :)

Offline nathan736

  • Full Member
  • ***
  • Posts: 143
  • Karma: 4
Re: [Help wanted] Restricting command arguments
« Reply #10 on: February 14, 2013, 10:57:49 AM »
i need your ranks  if they are inherited then you just cant target the people above them for not targeting people in there group idk about that
a person asked me how to code lua and i said this " its like building a rocket up side down then  realizing you did it all wrong."

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #11 on: February 14, 2013, 11:17:04 AM »
These are the ranks:
superadmin, inh from admin
admin, inh from moderator
moderator, inh from regular
regular, inh from user
user, inh from -----

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: [Help wanted] Restricting command arguments
« Reply #12 on: February 14, 2013, 12:28:26 PM »
Your inheritance tree looks like this:
user -> regular -> moderator -> admin -> superadmin

With how ULX works, any member of "admin" is also considered to be a member of "moderator", "regular" and "user". Therefore, the preferred method to select ONLY user and regular groups would be to use the string "!%moderator" (This means, can NOT select any user in group moderator-- which means they can't select admins or superadmins either)

And if I'm remembering correctly, you should be able to let them target themselves by adding ^, so your final string should look like this:
"!%moderator,^"  (This means can't target any users that have access to moderator permissions, and they can target themselves)

As for the ignore can_target checkbox, that ignores any restrictions applied to the GROUP as a whole. You can view what that restriction is by clicking on the dropdown box at the top-left corner of the groups tab, and selecting "Manage Groups..." (By default, groups are only allowed to target their own group and any groups below them)
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline zaph

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: [Help wanted] Restricting command arguments
« Reply #13 on: February 14, 2013, 01:05:21 PM »
Thank you for taking time to make a good and detailed awnser  :)

I only have one question left then. If you take a look at the last picture i posted you can se that I was able to slay all (!slay *) even though I had put !* in the restriction arguments.
Is there something im doing wrong, or can you only have groups and self In the restrictions?

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: [Help wanted] Restricting command arguments
« Reply #14 on: February 15, 2013, 07:03:09 AM »
In your case, an admin who says '!slay *' will only slay themselves, anyone in "regular", and anyone in "user". Since they aren't technically slaying everyone, it doesn't get blocked by the !* restriction. (At least, that's all off the top of my head, Megiddo would know for sure :P)

If you wanted the slay command to only target one person at a time, you'd have to make a very slight change to some ULX code.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6