SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 15/07/2011, 03:17 AM   #1
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,302
Reputation: 357
Cool jBan - MySQL Ban System with timed bans

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 Code:
#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 Code:
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 and Demo Page


You can view a demo of the example banlist here.

Credits
G-sTyLeZzZ - MySQL plugin
Y_Less - sscanf and hooking methods
__________________
Releases:
[Includes]: [jBan] | [jBanLite]
[Plugins]: [FileManager] | [Execute]
[Applications]: [Remote Administrator *NEW] | [Script King] | [RCON GUI]
[Tools]: [Random Spawn Array Generator]

Learn PAWN and more:
http://www.jatochnietdan.com



Last edited by JaTochNietDan; 29/07/2011 at 06:30 PM.
JaTochNietDan is offline   Reply With Quote
Old 15/07/2011, 03:19 AM   #2
Donya
Gangsta
 
Join Date: Mar 2011
Posts: 798
Reputation: 31
Default Re: jBan - MySQL Ban System with timed bans

Nice, also thanks for the example website.

tested! works fine
__________________
[FilterScript]Exception 0xC0000005 at 0x7F120E Protection | OnVehicleMod monitoring. Now Full Protection!

I'm sorry for what was posted earlier, I was hacked.
Donya is offline   Reply With Quote
Old 15/07/2011, 03:43 AM   #3
DRIFT_HUNTER
High-roller
 
DRIFT_HUNTER's Avatar
 
Join Date: Oct 2009
Posts: 1,409
Reputation: 64
Default Re: jBan - MySQL Ban System with timed bans

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
DRIFT_HUNTER is offline   Reply With Quote
Old 15/07/2011, 03:52 AM   #4
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,120
Reputation: 904
Default Re: jBan - MySQL Ban System with timed bans

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

(no homo.)
__________________

192.169.82.202:7777 - An awesome CnR server consisting of doozy features! Come, we have players!


Lorenc_ is offline   Reply With Quote
Old 15/07/2011, 04:18 AM   #5
RealCop228
Godfather
 
Join Date: Feb 2010
Location: Springboro, OH
Posts: 8,266
Reputation: 670
Default Re: jBan - MySQL Ban System with timed bans

It's nice to see a release from you. Now to make one compatible with SQLite!
__________________
Putting [URGENT] in the thread title stops me from opening the thread. Nobody else's problem on this forum is more important that another person's. Try not to be self-centered!
RealCop228 is offline   Reply With Quote
Old 15/07/2011, 05:04 AM   #6
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,120
Reputation: 904
Default Re: jBan - MySQL Ban System with timed bans

Quote:
Originally Posted by RealCop228 View Post
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.
__________________

192.169.82.202:7777 - An awesome CnR server consisting of doozy features! Come, we have players!


Lorenc_ is offline   Reply With Quote
Old 15/07/2011, 06:44 AM   #7
Cypress
Gangsta
 
Cypress's Avatar
 
Join Date: Dec 2009
Location: not your business
Posts: 789
Reputation: 70
Default Re: jBan - MySQL Ban System with timed bans

Would be cool to see a y_ini version.

Anyways nice work.
__________________



Last edited by Cypress; 15/07/2011 at 07:36 AM.
Cypress is offline   Reply With Quote
Old 15/07/2011, 07:16 AM   #8
BaubaS
Huge Clucker
 
Join Date: May 2011
Posts: 485
Reputation: 52
Default Re: jBan - MySQL Ban System with timed bans

Tried to look in jban.inc, and its like .amx fiile O_O
BaubaS is offline   Reply With Quote
Old 15/07/2011, 08:45 AM   #9
FireCat
Banned
 
Join Date: Jul 2010
Posts: 2,471
Reputation: 596
Default Re: jBan - MySQL Ban System with timed bans

Oh nice one jatoch.
FireCat is offline   Reply With Quote
Old 15/07/2011, 08:47 AM   #10
Swiftz
Banned
 
Join Date: Jan 2011
Posts: 338
Reputation: 0
Default Re: jBan - MySQL Ban System with timed bans

<3 this
Swiftz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
save bans in mysql table Ribber Scripting Help 2 06/01/2012 04:06 PM
[FilterScript] [FS] Timed help messages Winded Filterscripts 11 24/03/2010 07:05 AM
Timed kick keujh Help Archive 4 25/02/2010 07:34 AM
[MySQL]Bans jamesb93 Help Archive 0 23/12/2009 03:41 PM
...Timed gate? FrazZ Help Archive 9 07/04/2009 02:25 PM


All times are GMT. The time now is 10:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.