Author Topic: banning tools for certain userclasses  (Read 4376 times)

0 Members and 1 Guest are viewing this topic.

Offline jnewcombe

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
banning tools for certain userclasses
« on: March 08, 2008, 01:26:07 PM »
Hi


im after banning and adding tools for certain userclasses is it possible

im after adding a new class that can use advance dup but normal users cannot

can you explain how i do this please

Jon

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: banning tools for certain userclasses
« Reply #1 on: March 08, 2008, 02:39:03 PM »
toolallow, tooldeny, tooluserallow, tooluserdeny

Offline jnewcombe

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
Re: banning tools for certain userclasses
« Reply #2 on: March 08, 2008, 04:31:32 PM »
thanks will try editing groups.txt to include theese commands

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: banning tools for certain userclasses
« Reply #3 on: March 08, 2008, 07:44:46 PM »
currently there is no permanent way to allow or deny tools by group.

You CAN do it with ULX though.. but it requires modifying the tool's init.lua file with

Code: [Select]
if !ply:query("toolname") then
ULib.tsay(ply, "You are not allowed to use this tool", true)
return false
end

ply could be anything that the tool uses for the player entity.. usually ply, pl, or p

you would need to put this under the left click and the right click functions.

also.. then you'd need to add "toolname" to the group's allows in groups.txt

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: banning tools for certain userclasses
« Reply #4 on: March 08, 2008, 07:52:44 PM »
Jon, Can't use groups.txt to store those. Groups.txt would only deny or allow use of those commands, not actually tools with them.
You would need to use them in your server.ini (or any other cfg/maps/mapname.ini if you wanted only certain maps to deny/allow tools)

We currently don't have a group tool deny. We do have plans for it though due to recent demand.
http://ulyssesmod.net/bugs/view.php?id=159
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jnewcombe

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
Re: banning tools for certain userclasses
« Reply #5 on: March 14, 2008, 10:42:39 AM »
thanks for the helpful info again , looking forward to when you add this in the next version so i can put my advanced duplicator back on my server , we have too many noobs spamming stuff off it , so we want to set its use only to a trusted user class


thanks

Jon

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: banning tools for certain userclasses
« Reply #6 on: March 14, 2008, 12:18:42 PM »
What is the name of the groups you want to be allowed to use it? I will write the code you need to modify your advanced dupe and tell you where to change it. I just need the names of the groups ALLOWED to use it. (Ex. superadmin, admin, operator, member, etc)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: banning tools for certain userclasses
« Reply #7 on: March 14, 2008, 05:09:00 PM »
Zakap, I don't (and never if possible)recommend changing actual tool code, if that is what you had in mind for him.

I'm pretty sure Adv Dupe has a common 'toolmode' name (but don't know off hand what it is)
Look into gamemode.CanTool

Shouldn't be too difficult to write up a small plugin for Ulib.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: banning tools for certain userclasses
« Reply #8 on: March 14, 2008, 07:31:41 PM »
hmm.. I'll have to look into the cantool hook, because I have quite a few tools that I have modified on my server that query users for 'flags' and I have to redo the code every time I update them ;)

This will make my life easier too >.<

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: banning tools for certain userclasses
« Reply #9 on: March 14, 2008, 08:08:13 PM »
Heh. Yeah, I was thinking that you'd mentioned that when I was posting the response.
At time we discussed your modifications, I'd forgotten about that hook.

Lua is our friend.
Always easier to add chrome rims when possible to make a wheel shiny than it is to re-invent it, every time.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: banning tools for certain userclasses
« Reply #10 on: March 15, 2008, 02:24:21 AM »
lol at your metaphor Jam... but. I get the point =) I looked into it, pretty easy and a heck of a LOT cleaner than my current way.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: banning tools for certain userclasses
« Reply #11 on: March 15, 2008, 08:21:38 AM »
Jam Jam
Here Comes The Man
Hot ****

(**** in't allowed word :/)

(sorry for spam)

Edit by Megiddo: There's a reason for that. Don't swear here please.
« Last Edit: March 15, 2008, 01:03:21 PM by Megiddo »