[Include] jBan - MySQL Ban System with timed bans
#1

Introduction

jBan is a simple include that will allow server owners to easily have a player banning system using a MySQL 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.

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

Make sure that the jBan include has been put into your "pawno/includes" directory, then simply add the following to the script you wish to use jBan in:
pawn Код:
#include <jBan>
Next you need to open up your jBan.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 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/jBan/releases/tag/1.0

Credits
G-sTyLeZzZ - MySQL plugin
****** - sscanf and hooking methods
Reply
#2

Nice, also thanks for the example website.

tested! works fine
Reply
#3

Cool i checked the source
I suggest you to optimize temporary ban with time not like how much minutes
like if 2 parameters than first one is hours second one is minutes
but if just one parameter than its only minutes
Reply
#4

This is pree hot, I might try this out soon awesome stuff mate, hope to see more <3

(no homo.)
Reply
#5

It's nice to see a release from you. Now to make one compatible with SQLite!
Reply
#6

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
It's nice to see a release from you. Now to make one compatible with SQLite!
It'd be quite hard to get the SQLite database to show on a webpage, I haven't tried though I reckon it is. Mysql is more easier for such things for this.
Reply
#7

Would be cool to see a y_ini version.

Anyways nice work.
Reply
#8

Tried to look in jban.inc, and its like .amx fiile O_O
Reply
#9

Oh nice one jatoch.
Reply
#10

<3 this
Reply
#11

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
Tried to look in jban.inc, and its like .amx fiile O_O
It's definitely not an AMX file, it's probably because you opened it in Microsoft Notepad, which really doesn't like the Unix newline formatting, I've converted it to Windows formatting, so just download the file and open it again in Notepad

I recommend you get Notepad++, much more useful and it recognizes both Windows and Unix formatting
Reply
#12

Works fine in MS Notepad. You may also want to note that you need ZCMD to compile the PAWN script. Anyway, it's a pretty nice script .
Reply
#13

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
It'd be quite hard to get the SQLite database to show on a webpage, I haven't tried though I reckon it is. Mysql is more easier for such things for this.
I don't believe it is nearly as hard as you would imagine. I'm sure if someone can create a forum to work with SQLite, then creating such a web page would be possible too!
Reply
#14

Another awesome release.

Thanks nitedan!
Reply
#15

Why does it mess up when you uncomment //kick?
Reply
#16

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I don't believe it is nearly as hard as you would imagine. I'm sure if someone can create a forum to work with SQLite, then creating such a web page would be possible too!
It's very easy when you have the PDO for SQLite in PHP.
Reply
#17

Quote:
Originally Posted by John_Cooper
Посмотреть сообщение
Why does it mess up when you uncomment //kick?
Thanks for pointing that out, I forgot I must have left it commented when I was testing it. I've re-uploaded it now without the commented kick function

Although I don't know what you mean by "mess up", it should be fine.
Reply
#18

Hmm works fine now but now im having problems with sometimes when people join they dont get the ban message just kicked from the server. It happens like 1/4 Times.
Reply
#19

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Thanks for pointing that out, I forgot I must have left it commented when I was testing it. I've re-uploaded it now without the commented kick function

Although I don't know what you mean by "mess up", it should be fine.
It's probably this problem:
https://sampforum.blast.hk/showthread.php?tid=268432
I had it with my MySQL ban system too.
Reply
#20

Good job, I'm sure there are quite some servers that could use this ^^
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)