SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/07/2011, 12:01 AM   #1
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,301
Reputation: 357
Cool jBanLite - SQLite Ban System with timed bans

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


You can view a demo of the example banlist here.

Credits
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; 01/08/2011 at 04:13 AM.
JaTochNietDan is offline   Reply With Quote
Old 18/07/2011, 12:07 AM   #2
Gh0sT_
Gangsta
 
Join Date: Sep 2010
Location: Lithuania, Alytus
Posts: 776
Reputation: 0
Default Re: jBanLite - SQLite Ban System with timed bans

You should set ban time to "PLAYER HAS BEEN UNBANNED" when time pass 0. Because now that -*number* is for nothing?
__________________
Includes
Player/Vehicle Control
Entrances system
Gh0sT_ is offline   Reply With Quote
Old 18/07/2011, 12:19 AM   #3
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,301
Reputation: 357
Default Re: jBanLite - SQLite Ban System with timed bans

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


JaTochNietDan is offline   Reply With Quote
Old 18/07/2011, 12:28 AM   #4
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,074
Reputation: 406
Default Re: jBanLite - SQLite Ban System with timed bans

Just a question, with this, does the sa-mp server have to be on the same server as the website?
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Old 18/07/2011, 12:35 AM   #5
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,301
Reputation: 357
Default Re: jBanLite - SQLite Ban System with timed bans

Quote:
Originally Posted by [HiC]TheKiller View Post
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.
__________________
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


JaTochNietDan is offline   Reply With Quote
Old 18/07/2011, 12:46 AM   #6
Ari3l
Huge Clucker
 
Join Date: Aug 2010
Location: Puerto Madryn
Posts: 244
Reputation: 3
Default Respuesta: jBanLite - SQLite Ban System with timed bans

Nice Job!
Ari3l is offline   Reply With Quote
Old 18/07/2011, 02:52 PM   #7
Toreno
Gangsta
 
Join Date: Nov 2010
Posts: 846
Reputation: 41
Default Re: jBanLite - SQLite Ban System with timed bans

That's nice include, I might use it.
Toreno is offline   Reply With Quote
Old 18/07/2011, 05:57 PM   #8
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,506
Reputation: 233
Default Re: jBanLite - SQLite Ban System with timed bans

What change jBan and jBanLite?
__________________
TheArcher is online now   Reply With Quote
Old 18/07/2011, 05:59 PM   #9
Donya
Gangsta
 
Join Date: Mar 2011
Posts: 797
Reputation: 31
Default Re: jBanLite - SQLite Ban System with timed bans

Quote:
Originally Posted by Anthony_prince View Post
What change jBan and jBanLite?
jBanLite uses SQLite

jBan uses MySQL

get it? :P
__________________
[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 18/07/2011, 06:10 PM   #10
!!--Ryder_RO--!!
Big Clucker
 
Join Date: Jun 2011
Location: Romania
Posts: 124
Reputation: 13
Default Re: jBanLite - SQLite Ban System with timed bans

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
__________________
Hi ^^
!!--Ryder_RO--!! 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
[Include] jBan - MySQL Ban System with timed bans JaTochNietDan Includes 83 09/06/2014 12:19 PM
[FilterScript] LorencBank (SQLite Bank system) Lorenc_ Filterscripts 18 13/01/2012 06:11 PM
Sqlite Vehicle System Bugging Norn Help Archive 3 02/10/2010 12:42 AM
Timed kick keujh Help Archive 4 25/02/2010 07:34 AM
SendClientMessage timed CracK Help Archive 17 13/03/2009 11:33 AM


All times are GMT. The time now is 06:28 PM.


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