[Include] jBanLite - SQLite Ban System with timed bans
#1

Introduction

jBanLite is a simple include that will allow server owners to easily have a player banning system using an SQLite database as the storage center for the ban information. It should be compatible with just about every script out there, I've taken steps to ensure that there are no conflicts with other scripts and that it should be as easy to use as possible for newbies.

* Yes this is the same thing except for SQLite, although I decided to create another topic as it may confuse some users as to what they need to download, so I'd like to keep it separate.

Additionally, this ban system does not ban people's nicknames, it will only ban people's IP addresses


What's in the package?
  • The jBanLite include
  • An example Filterscript
  • An example website
Instructions

Make sure that the jBanLite include has been put into your "pawno/includes" directory, then simply add the following to the script you wish to use jBanLite in:
pawn Код:
#include <jBanLite>
Next you need to open up your jBanLite.inc file and edit the settings in there accordingly, you will need to at least enter in the details of your MySQL server and database.

Then you simply add the ban/unban functions where you need them and let the include do the work, if you're confused about it at this stage, please look at the Filterscript provided in the download package as an example.

Functions

pawn Код:
native jBan(player_banned, player_banner, reason[], time = 0);
// This function will create a new ban for player_banned by player_banner with a reason[] and a time. The time parameter can be used to set the ban length in minutes, it defaults to 0 (permanent).

native jBanIP(ip[], player_banner, reason[], time = 0);
// This function will create a new ban with the IP you specify. Everything else is the same as jBan.

native jUnbanName(name[], bool:expired = false);
//This function will remove a ban from the list with the name you specify. The expired parameter will specify whether or not you want to remove bans that have expired, it defaults to false, which will not remove expired bans.

native jUnbanIP(IP[], bool:expired = false);
// This function will remove a ban from the list with the IP you specify. The expired parameter will specify whether or not you want to remove bans that have expired, it defaults to false, which will not remove expired bans.
Download
https://github.com/JaTochNietDan/jBa...leases/tag/1.0

Credits
****** - sscanf and hooking methods
Reply
#2

You should set ban time to "PLAYER HAS BEEN UNBANNED" when time pass 0. Because now that -*number* is for nothing?
Reply
#3

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
You should set ban time to "PLAYER HAS BEEN UNBANNED" when time pass 0. Because now that -*number* is for nothing?
If you mean on the website, then I have done that now, it says expired for bans that are finished
Reply
#4

Just a question, with this, does the sa-mp server have to be on the same server as the website?
Reply
#5

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Just a question, with this, does the sa-mp server have to be on the same server as the website?
Yes currently, although you could setup some sort of FTP system where it would read the database from remotely, but it would be messy indeed. That's the only downside to using SQLite, the upside is that it's lightweight and probably easier to use for the average newbie.

Update: I made the times on the example website far more readable, they now display in days, hours, minutes and seconds left. This update was on both of the jBan systems.
Reply
#6

Nice Job!
Reply
#7

That's nice include, I might use it.
Reply
#8

What change jBan and jBanLite?
Reply
#9

Quote:
Originally Posted by Anthony_prince
Посмотреть сообщение
What change jBan and jBanLite?
jBanLite uses SQLite

jBan uses MySQL

get it? :P
Reply
#10

Good job!!

Who helped me and me with my GM? has a big problem, I think it's a bug: D
want to help me give me a pm
Reply
#11

Ah no jbBanIP? I could really use that seeing as their is an IP unban.
Reply
#12

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
Ah no jbBanIP? I could really use that seeing as their is an IP unban.
I've added it, check the main post!
Reply
#13

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
I've added it, check the main post!
So fast.. Thanks.. I was trying to script it but failing. You rock.

What exactly is "name of ban"?

I see its the "name of player stored at string" does it actually matter or is it for administrative purposes?
Reply
#14

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
So fast.. Thanks.. I was trying to script it but failing. You rock.

What exactly is "name of ban"?

I see its the "name of player stored at string" does it actually matter or is it for administrative purposes?
It doesn't particularly matter, but the SQL table will expect some sort of name, you could just enter in a blank string.

Edit: On second thought, with the way the system works it would be better for it always to be a blank string when banning by an IP address. So I've changed that function now.
Reply
#15

this is very useful , the most for freeroam servers or RP.

thanks i'm sure i'm going to use this thanks.
Reply
#16

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
It doesn't particularly matter, but the SQL table will expect some sort of name, you could just enter in a blank string.

Edit: On second thought, with the way the system works it would be better for it always to be a blank string when banning by an IP address. So I've changed that function now.
Do you think you could make a version for me where IPBan's and Account Ban's are seperate? Because right now if I'm understanding it account banning will ban the IP aswell and I'd like to keep them seperate.
Reply
#17

good job il will use it
Reply
#18

The unbanip doesn't appear to be working for me but banning does.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)