Author Topic: restrict amount of targeted users  (Read 2500 times)

0 Members and 1 Guest are viewing this topic.

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
restrict amount of targeted users
« on: March 22, 2014, 06:09:21 PM »
Hello there,

I'd like to know if it is possible to restrict the slap command for instance, so only one user can be targeted at a time?
 I want it so moderators cannot use "!slap *".

Thanks in advance,
Avoid

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: restrict amount of targeted users
« Reply #1 on: March 24, 2014, 11:23:34 AM »
Unfortunately I don't believe this can be done with stock ULX. There are three things you could try:

 - Modify the ulx slap command to only allow one target player, but that would affect admins and superadmins as well.
 - Make a duplicate of the ulx slap command with a slightly different name, then modify that to only allow one target. Give your moderators access to the duplicate command instead of the regular ulx slap.
 - Modify the ulx slap command to make it only slap one target from the input if the calling player is in a specific group. This one will do what you want without a separate command, but the groups will have to be hard-coded in the script, and it's a little more involved.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: restrict amount of targeted users
« Reply #2 on: March 24, 2014, 12:23:41 PM »
Would you not just change the can target for that one command for moderators? So in the box when you click the command in XGUI have the can target !%rankname - then for the next rank up you would remove the restriction?

Owen


Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: restrict amount of targeted users
« Reply #3 on: March 24, 2014, 03:13:59 PM »
Would you not just change the can target for that one command for moderators? So in the box when you click the command in XGUI have the can target !%rankname - then for the next rank up you would remove the restriction?

Owen
What he means is he wants to be able to set a number of users that can be targeted at one time, regardless of can_target. So, if !slap * was performed, there would be an error message if > x players were online, x being the restriction on allowed targets per command.
In metaphor form, he wants to be able to give his usergroups a gun, but only give them a certain amount of bullets per magazine (sorry if not G).
bw81@ulysses-forums ~ % whoami
Homepage

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: restrict amount of targeted users
« Reply #4 on: March 24, 2014, 04:25:05 PM »
Ah, well, I should probably stop trying to help people :P

My only suggestion then would be to only give them commands to people you trust.

Owen


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: restrict amount of targeted users
« Reply #5 on: March 24, 2014, 07:46:17 PM »
would be to only give them commands to people you trust.

We've been preaching to the choir about this for years.
Unfortunately, it seems the congregation wants everyone to be superadmins or similar.  :/
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: restrict amount of targeted users
« Reply #6 on: March 25, 2014, 09:45:51 AM »
Hello,
Thanks for all those answers!

I do trust my moderators, as I do not give out permissions to people who I do not trust.
I just wanted to know if this is possible or not!
So I guess I will try to edit the command itself.

Thanks a bunch,
Avoid