SA-MP Forums Archive
[Include] jBan - MySQL Ban System with timed bans - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] jBan - MySQL Ban System with timed bans (/showthread.php?tid=269126)

Pages: 1 2 3


jBan - MySQL Ban System with timed bans - JaTochNietDan - 15.07.2011

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? 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


Re: jBan - MySQL Ban System with timed bans - Donya - 15.07.2011

Nice, also thanks for the example website.

tested! works fine


Re: jBan - MySQL Ban System with timed bans - DRIFT_HUNTER - 15.07.2011

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


Re: jBan - MySQL Ban System with timed bans - Lorenc_ - 15.07.2011

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

(no homo.)


Re: jBan - MySQL Ban System with timed bans - Scenario - 15.07.2011

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


Re: jBan - MySQL Ban System with timed bans - Lorenc_ - 15.07.2011

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.


Re: jBan - MySQL Ban System with timed bans - Cypress - 15.07.2011

Would be cool to see a y_ini version.

Anyways nice work.


Re: jBan - MySQL Ban System with timed bans - BaubaS - 15.07.2011

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


Re: jBan - MySQL Ban System with timed bans - FireCat - 15.07.2011

Oh nice one jatoch.


Re: jBan - MySQL Ban System with timed bans - Swiftz - 15.07.2011

<3 this


Re: jBan - MySQL Ban System with timed bans - JaTochNietDan - 15.07.2011

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


Re: jBan - MySQL Ban System with timed bans - [HiC]TheKiller - 15.07.2011

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 .


Re: jBan - MySQL Ban System with timed bans - Scenario - 15.07.2011

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!


Re: jBan - MySQL Ban System with timed bans - Davz*|*Criss - 15.07.2011

Another awesome release.

Thanks nitedan!


Re: jBan - MySQL Ban System with timed bans - John_Cooper - 16.07.2011

Why does it mess up when you uncomment //kick?


Re: jBan - MySQL Ban System with timed bans - Calgon - 16.07.2011

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.


Re: jBan - MySQL Ban System with timed bans - JaTochNietDan - 16.07.2011

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.


Re: jBan - MySQL Ban System with timed bans - John_Cooper - 16.07.2011

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.


Re: jBan - MySQL Ban System with timed bans - *IsBack - 16.07.2011

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.


Re: jBan - MySQL Ban System with timed bans - Hiddos - 16.07.2011

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