[Release] FiveM-BanSql

FiveM-BanSql

An SQL ban that does not overload the database.
It precharges the database in a table when opening the server or adding / removing a ban.

Installation

  1. Download : Last Release
  2. Copy the project to your resource folder.
  3. Add “start FiveM-BanSql” in your server.cfg
    Make sure FiveM-BanSql start AFTER require resources.
    Like This
start baseevents 
start mysql-async 
start essentialmode 
start esplugin_mysql
start async 
start FiveM-BanSql

I recommand you to use this too to prevent ip change.

Commands


  1. sqlban id days reason ( Allows ban a connected player )
  • “id” is the player’s number in the list
  • “days” must be a number to say how many days it will be ban. (0 days mean permanent)
  • “reason” Ability to register why he is banished. Attention if there is no reason the player will see: “You are banned for: unknown reason”
  • example /sqlban 3 1 Troll (Will give ban player # 3 for 1 days with Troll reason)

  1. sqlbanoffline permid days reason ( Allows ban a offline player )
  • “permid” get from command sqlsearch
  • “days” must be a number to say how many days it will be ban. (0 days mean permanent)
  • “reason” Ability to register why he is banished. Attention if there is no reason the player will see: “You are banned for: unknown reason”
  • example /sqlbanoffline 1 1 cheating (Will ban first player in database 1 day for cheating)
    2.1 sqlsearch (name)
  • “name” is the player’s steam name
  • example /sqlsearch name (Will show you permid and name of found players)

  1. sqlunban “Steam Name”
  • Deban the player matching the written name.
  • Example /sqlunban Alex Garcio (Will remove from the ban list the player)

  1. sqlbanreload (reload the BanList and the BanListHistory)
  • Can be used if you edit directly in your database.

  1. sqlbanhistory option (Allows you to view the ban history of a player offline or online)
  • “option”
  • (Steam Name) To display all the bans of a player
  • 1 To display only the first ban
  • 2 To display only the second ban
  • 3 ect …
  • 4 ect …
  • Example /sqlbanhistory Alex Garcio (Go to display all the list of this player’s bans)

Required resource

Created by

Here you can find Source Code

14 Likes

Moved to #development:releases

What if you are trying to unban a player that has a common steam name. On the note of using steam ids, people can just create new accounts. Might be best to use a combination of steamids and licenses.

Anyways, thanks for releasing this to the community.

2 Likes

@J.Manlet Yes i have this in mind too.

2 Likes

Licenses are the best way to go. Steam Ids as a backup but so many people have vpns there’s days so there is not point in doing IPs

I keep getting this error, any reason why?

@Mercys Try this version V1.0.2

1 Like

possible way to implement in-game commands to executing these commands or is it only via server access?

hey this is a super nice release im going to try it out thanks a lot i appreciate the work

@Detoxz all command are build for in game use.
If you have any problem with post me your full error message on F8 in game or console and i will fix it fast.

1 Like

could you modify this so it checks the database if any bans have been added fresh when someone joins so u dont need to reload after adding someone to it DB wise because i find myself having to try and add someone but not being able to get into the server to use the command to refresh. it would be nice if it would check on its own on a player join request

@Skrubby If i understand well, you and edit the SQL to add one ban right?
And the ressource don’t see the new ban because the list is loaded but not reload after an SQL edit.
If i will make command available in console this can do what you want to do?

1 Like

yea i mean that could do it just as Easy but i think the easier way to handle it for everyone as a whole is to make it so if i go to join the server when i connect it checks the database live to see if theres a ban in there than either does or does not let me in. you know? instead of loading the database in on firstload it checks it every time.

I simply get no return message in game besides the default EssentialsMode invalid command chat return which shouldn’t be an issue, and nothing appears in the client console or server console regarding any type of error.

the game treats it as if it’s non existent. I have the DB setup , i have the resource started with 0 errors, and I get 0 errors in the Client Console or Server console , I’ve even done another fresh install for the same result

@Detoxz Have you the load confirm of the ressource?
In console
The BanList has been loaded successfully.
The BanListHistory has been loaded successfully.
?

1 Like

@Skrubby The “preload” of the banlist is to save sql request on all connect attemp.
But if it’s you realy want i can make the preload as an option too.

1 Like

Yep, that shows up in the server console with 0 errors

Release edited to add this

Make sure FiveM-BanSql start AFTER require resources.
Like This

start baseevents 
start mysql-async 
start essentialmode 
start esplugin_mysql
start async
start FiveM-BanSql
1 Like

i think as a option it would be okay. the database is assessed a lot and i dont think the request to check it would be too bad. i would put it as a option true false some people may not like it.