sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
Information
Script is made with easy-mysql made by ThePhenix, so it uses the latest version of BlueG's MySQL plugin that can be found here, this system is configurable on some parts, you can change the table's name from configuration panel, tables will be created automatically, you don't have to do anything, you just need to edit MySQL connection configuration to your own
About
Well, this is a part from my script (sbAdmin) that I didn't release yet. Probably I will late to release because I have some other things on going, so I am releasing this from now. If you find any bugs please report them here, on this topic
Images
Permament Ban
Temp Ban
Temp Ban after expires
Installation
Just edit MySQL's configuration defines to your host's one and then load sbBan.amx file to your server
Download
MySQL Plugin
Download
Pastebin
Download
Mediafire
Download
easy-mysql.inc
Download
Updates
I was planned to add /oban command but I can't get player's ip, I have to create a new register system in your database and it is something that I don't want to do "BANS_TABLE" is the table where bans will be saved so I have to create another so I can save player's IPs so when I do /oban system will be able to get ip offline, it is already added on sbAdmin, so I will not add this on this include, wait for sbAdmin xD
Re: sbBan - Advanced MySQL Ban System -
Pottus - 28.10.2015
You don't even save the players gpci this will be completely ineffective profiling goes a long way.
Re: sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
Quote:
Originally Posted by Pottus
You don't even save the players gpci this will be completely ineffective profiling goes a long way.
|
I am sorry but I don't know how to save gpci, none of the ban systems that I have seen till now saves gpci...
Re: sbBan - Advanced MySQL Ban System -
Gammix - 28.10.2015
Your delay kick is having a lot of interval between, 2000 ms !!
Actually you should take care of other things while the kick is being executed (delayed), such as returning 0 in callbacks. Try to read/include
SAMP_Fixer/fix_kick.inc.
Re: sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
Quote:
Originally Posted by Gammix
Your delay kick is having a lot of interval between, 2000 ms !!
Actually you should take care of other things while the kick is being executed (delayed), such as returning 0 in callbacks. Try to read/include SAMP_Fixer/fix_kick.inc.
|
I am using 2 callbacks, one to create the tables (
OnFilterScriptInit) and another to check if player is banned (
OnPlayerConnect), the second one returns true if player is banned to avoid login boxes etc. so I don't think that return 0; will be called, I will fix DelayKick on next version, I don't want to release a new version for just DelayKick
Re: sbBan - Advanced MySQL Ban System -
Gammix - 28.10.2015
Quote:
Originally Posted by SecretBoss
I am using 2 callbacks, one to create the tables (OnFilterScriptInit) and another to check if player is banned (OnPlayerConnect), the second one returns true if player is banned to avoid login boxes etc. so I don't think that return 0; will be called, I will fix DelayKick on next version, I don't want to release a new version for just DelayKick
|
I gave you fix_kick as a reference, for a reason.
For example: If the delay kick is executed (yet the timer is still alive) and the player types any command, that command will executed as well. So you need to return 0 in OnPlayerCommandText when the delay kick is ON. Similar for few other callbacks.
Re: sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
OnPlayerCommandText is called on
izcmd include not in my script
Re: sbBan - Advanced MySQL Ban System -
Gammix - 28.10.2015
I just gave an example, and still it is called through izcmd. And you should return 0 to avoid the to-be-kicked player to use any commands (return 0 in OnPlayerCommandReceived).
Re: sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
Yea but how can I check if timer is active?
Re: sbBan - Advanced MySQL Ban System -
jlalt - 28.10.2015
PHP код:
new banned[MAX_PLAYERS];
When you set timer:
PHP код:
banned[playerid] = 1;
On command:
PHP код:
if(banned[playerid] == 1) return SendClientMessage(...)
On timer end
PHP код:
banned[playerid] = 0;
Re: sbBan - Advanced MySQL Ban System -
Gammix - 28.10.2015
Quote:
Originally Posted by SecretBoss
Yea but how can I check if timer is active?
|
Timers should always be created with the right way.
Here is an example:
pawn Код:
//create a variable for a timer
//set it to "-1" as default
new
time = -1
;
//now check if the timer is already existing
if (timer != -1)
{
//this means the timer is already existing, destroy it
KillTimer(timer);
}
//set the timer now
timer = SetTimer("OnTimerComplete", ...);
//when your timer complete
forward OnTimerComplete();
public OnTimerComplete()
{
//set the variable back to "-1" which means the timer is invalid
timer = -1;
}
So you can check the timer is existing through that method.
pawn Код:
public OnPlayerCOmmandReceived(playerid, sucess)
{
if (timer != -1)
{
return 0;
}
}
You can still read the fix_kick.inc code.
Re: sbBan - Advanced MySQL Ban System -
SecretBoss - 28.10.2015
Quote:
Originally Posted by Gammix
Timers should always be created with the right way.
Here is an example:
pawn Код:
//create a variable for a timer //set it to "-1" as default new time = -1 ;
//now check if the timer is already existing if (timer != -1) { //this means the timer is already existing, destroy it KillTimer(timer); } //set the timer now timer = SetTimer("OnTimerComplete", ...);
//when your timer complete forward OnTimerComplete(); public OnTimerComplete() { //set the variable back to "-1" which means the timer is invalid timer = -1; }
So you can check the timer is existing through that method.
pawn Код:
public OnPlayerCOmmandReceived(playerid, sucess) { if (timer != -1) { return 0; } }
You can still read the fix_kick.inc code.
|
Thanks I will update it on next version
Re: sbBan - Advanced MySQL Ban System -
N0FeaR - 01.11.2015
I like it good job (y)
Re: sbBan - Advanced MySQL Ban System -
Kevln - 01.11.2015
Quote:
Originally Posted by Gammix
Timers should always be created with the right way.
Here is an example:
pawn Код:
//create a variable for a timer //set it to "-1" as default new time = -1 ;
//now check if the timer is already existing if (timer != -1) { //this means the timer is already existing, destroy it KillTimer(timer); } //set the timer now timer = SetTimer("OnTimerComplete", ...);
//when your timer complete forward OnTimerComplete(); public OnTimerComplete() { //set the variable back to "-1" which means the timer is invalid timer = -1; }
So you can check the timer is existing through that method.
pawn Код:
public OnPlayerCOmmandReceived(playerid, sucess) { if (timer != -1) { return 0; } }
You can still read the fix_kick.inc code.
|
Horribly wrong and unnecessary, read the replies here:
https://sampforum.blast.hk/showthread.php?tid=592714