• Print

Author Topic: Wanting to disable the ulx ban module but still log the bans.  (Read 7223 times)

0 Members and 1 Guest are viewing this topic.

Offline ericprince811

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Wanting to disable the ulx ban module but still log the bans.
« on: November 01, 2015, 08:53:00 pm »
I want the ulx ban command to still be fully function and be able log the person and the ban. However I do not want it to where after the kick happens the ban message comes up on rejoin. What my goal is I am trying to replace the ban system to where they can rejoin but if found on the ulx ban list it will jail on spawn. Do not question I just need a straight answer.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #1 on: November 01, 2015, 09:08:26 pm »
Can't be done using normal ULX.

This area isn't the place to discuss how: the Developers Corner is.
Use ULib's command call translate hooks to intercept the ulx ban command and do whatever you wish.
I strongly advise modifying ban though.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline ericprince811

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #2 on: November 02, 2015, 07:11:48 am »
How would i go upon doing so? I also am using the jail on spawn dor something much bigger. Its only a test stage.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #3 on: November 02, 2015, 03:16:49 pm »
I really don't recommend doing this as a replacement for ban.
No, really.
Too much to go wrong. Make a new punishment, and remove ban from any admin staff you don't want banning but don't mind jailing.

There are several ULib hooks to monitor for what you want though.
One possible -  "ULibPlayerTargets"
Monitor for "ulx blah" command, the write your own code/tracking/logging/whatever, return false, "message" to ULX and it will stop the "blah" command
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #4 on: November 02, 2015, 06:49:18 pm »
Either way it's going to be a bit of work. If you want to replace ban, I'm sure there is a lot of code you need to replace. But if you don't replace ban but want the ban logging functionality, then you'll need to copy the logging code.
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 WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #5 on: November 04, 2015, 01:54:00 pm »
Tell your admins to use !jban, and remove their !ban rights. Put that in your /addons/ulx/lua/ulx/modules/sh/ after being put in an editor and saved as .lua. Or download the file here.
Code: Lua
  1. local CATEGORY_NAME = "Advanced Cmds"
  2.  
  3. function ulx.jban( calling_ply, target )
  4.         ULib.Kick( target, "Jail Banned from server. Connect and be jailed." ) -- Not a ban, this way we eliminate the process of reading banned_user.cfg and unbanning, etc.
  5.         ulx.fancyLogAdmin( calling_ply, "#A has Jail Banned #T.", target ) -- Annouces the ban
  6.         if target:IsConnected() then -- If they join, well do the below
  7.                 target:ChatPrint( "Jailed." ) -- Tell them the kick warning was true.
  8.                 ULib.Gag( target )
  9.                 ULib.Jail( target )
  10.                 ULib.Mute( target )
  11.         end
  12. end
  13. local jban = ulx.command( CATEGORY_NAME, "ulx jban", ulx.jban, "!jban" )
  14. jban:defaultAccess( ULib.ACCESS_ADMIN )
  15. jban:help( "Easier way to ban, but able to humilify if they rejoin." )
You must be logged in to download.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #6 on: November 04, 2015, 04:10:18 pm »
Wispy, your command will have no target variable.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #7 on: November 04, 2015, 05:29:49 pm »
Wispy, your command will have no target variable.
I'm confused *facepalm* should it be target_ply? Or do I have to actually make target a variable?


Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #8 on: November 04, 2015, 07:00:03 pm »
I'm confused *facepalm* should it be target_ply? Or do I have to actually make target a variable?

You need to use addParam.

Code: Lua
  1. jban:addParam{ type=ULib.cmds.PlayerArg }

Either way, your function won't do anything other than kick them. The if loop will be run after they are kicked: it will return false, and the function will end.
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 WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #9 on: November 04, 2015, 07:03:52 pm »
True :D I guess I didn't think of that.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Wanting to disable the ulx ban module but still log the bans.
« Reply #10 on: November 04, 2015, 10:27:43 pm »
Using the above, you can edit it a tad and replace it from !jban to !ban if you want. Just go on ulib/ulx files, and competely remove the ban feature. Though I wouldn't recommend this, the list for the "new bans" would never work in xgui, you'd have to edit that too.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

  • Print