Author Topic: -snip snap-  (Read 475 times)

0 Members and 1 Guest are viewing this topic.

Offline anyome

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
-snip snap-
« on: October 13, 2019, 08:34:20 AM »
RESOLVED THANKS
« Last Edit: October 13, 2019, 04:09:19 PM by anyome »

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 786
  • Karma: 54
Re: [ULX] Unban All Players [Paying 20$ Paypal]
« Reply #1 on: October 13, 2019, 08:59:25 AM »
Since ULib stores bans in the sv.db, it must create a table through the SQL Library.

I won't do it all for you, but I can give you an idea as to how I would do this:

Code: Lua
  1. function ulx.unbanAll(calling_ply)
  2.     -- I would recommend only running this from the console, so verify that the calling_ply is not a player. This is optional, but I recommend doing it.
  3.     if IsValid(calling_ply) and calling_ply:IsPlayer() then
  4.         ULib.tsayError(calling_ply, "You cannot use this in-game. Please execute using the server's console or RCon.", true)
  5.         return
  6.     end
  7.  
  8.     -- Next, we just need to wipe the table.
  9.     -- Use sql.Query() (http://wiki.garrysmod.com/page/sql/Query) to issue a DELETE FROM command to the 'ulib_bans' table (https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/apsg/src/tpc/db2z_deletedatatables.html)
  10. end
  11. local unbanall = ulx.command("User Management", "ulx unbanall", ulx.unbanAll)
  12. unbanall:defaultAccess(ULib.ACCESS_NONE)
  13.  

It's very simple. Let me know if you have questions.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me a PM or Join my Discord!.
--==[ Links ]==--
Steam
YouTube
Steam Group (feel free to join!)
Discord

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8036
  • Karma: 383
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: -snip snap-
« Reply #2 on: October 13, 2019, 06:05:40 PM »
Unless the original poster was using code I now don't see, Ulib does not use sv.db for bans.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming