[Release] FiveM-BanSql

mysql
async
ban
sql
#1

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 days name ( Allows ban a offline player )
  • “days” must be a number to say how many days it will be ban. (0 days mean permanent)
  • “name” is the player’s steam name
  • example /sqlbanoffline 3 Alex Garcio (Will ask you to entry ban:reason to continu)
    2.1 sqlreason (reason)
  • “reason” Ability to register why he is banished.
  • example /sqlreason reason (Will ban player you have entry before for X days and the reason)

  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)

  1. bansql (Will show in game commands)
  • Example /bansql

Required resource

Created by

Here you can find Source Code

6 Likes

[Release] [Bug Fix] Esx Scripts and some server suggestions
#2

Moved to #development:releases

0 Likes

#3

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

#4

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

2 Likes

#5

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

0 Likes

#6

I keep getting this error, any reason why?

0 Likes

#7

@Mercys Try this version V1.0.2

1 Like

#8

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

0 Likes

#9

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

0 Likes

#10

@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

#11

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

0 Likes

#12

@Skrubzilla1 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

#13

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.

0 Likes

#14

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.

0 Likes

#15

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

0 Likes

#16

@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

#17

@Skrubzilla1 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

#18

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

0 Likes

#19

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

#20

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.

0 Likes