SA-MP Forums Archive
[FilterScript] [MYSQL R41-2] Ban / Unban System - 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)
+--- Thread: [FilterScript] [MYSQL R41-2] Ban / Unban System (/showthread.php?tid=658383)

Pages: 1 2


Re: [MYSQL R41-2] Ban / Unban System - TheToretto - 04.09.2018

Quote:
Originally Posted by brauf
Посмотреть сообщение
and that's why he corrected you.
"Savage: 100%"

true


Re: [MYSQL R41-2] Ban / Unban System - KinderClans - 04.09.2018

Ah, you forgot the most important thing. You should also save the time/date of the ban. It's really useful.


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 04.09.2018

Quote:
Originally Posted by SonnyGamer
Посмотреть сообщение
I suggest you to create mysql admin system. Use this system and add some other admin commands: warn, kick, jail, freeze etc...
Good Job anyway
I've started making WAdmin today, i'll release it in a few days. Thanks for the suggestion

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
Ah, you forgot the most important thing. You should also save the time/date of the ban. It's really useful.
Yes, actually thought about it today and was planning on updating it, thank you. I've updated it once again, added time/date.


Re: [MYSQL R41-2] Ban / Unban System - CaptainBoi - 05.09.2018

database is not getting created on server on
Edit: replace
PHP код:
mysql_query(BansDB"CREATE TABLE IF NOT EXISTS `bans` (\
    `BanID` int(10) AUTO_INCREMENT PRIMARY KEY, \
    `Username` VARCHAR(24) NOT NULL, \
    `BannedBy` VARCHAR(24) NOT NULL, \
    `BanReason` VARCHAR(128) NOT NULL, \
    `IpAddress` VARCHAR(17) NOT NULL, \
    `Date` VARCHAR(30) NOT NULL"
); 
to
PHP код:
mysql_query(BansDB"CREATE TABLE IF NOT EXISTS `bans` (\
    `BanID` int(10) AUTO_INCREMENT PRIMARY KEY, \
    `Username` VARCHAR(24) NOT NULL, \
    `BannedBy` VARCHAR(24) NOT NULL, \
    `BanReason` VARCHAR(128) NOT NULL, \
    `IpAddress` VARCHAR(17) NOT NULL, \
    `Date` VARCHAR(30) NOT NULL)"
); 
1 bracket is missing
change the database in script


Re: [MYSQL R41-2] Ban / Unban System - CaptainBoi - 05.09.2018

their is problem with ban cmd
it wont work till you replace this with it
Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 4) return 0;
	new PlayerIP[17];
	new giveplayerid, reason[128], string[150], query[700];
	GetPlayerIp(giveplayerid, PlayerIP, sizeof(PlayerIP));
	if(sscanf(params, "us[128]", giveplayerid, reason)) return Usage(playerid, "/ban [playerid] [reason]"); 
	if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "That player is not connected");
	mysql_format(BansDB, query, sizeof(query), "INSERT INTO `bans` (`Username`, `BannedBy`, `BanReason`, `IpAddress`, `Date`) VALUES ('%e', '%e', '%e', '%e'), '%e'", playername(giveplayerid), playername(playerid), reason, PlayerIP, ReturnDate());
	mysql_tquery(BansDB, query, "", "");
	format(string, sizeof(string), "SERVER: %s[%d] was banned by %s, Reason: %s", playername(giveplayerid), giveplayerid, playername(playerid), reason);
	SendClientMessageToAll(-1, string);
	pkickbantimer[playerid] = SetTimerEx("KickBanTimer", 1000, 0, "dd", giveplayerid, 2);
	return 1;
}
Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 4) return 0;
	new PlayerIP[17];
	new giveplayerid, reason[128], string[150], query[700];
	GetPlayerIp(giveplayerid, PlayerIP, sizeof(PlayerIP));
	if(sscanf(params, "us[128]", giveplayerid, reason)) return Usage(playerid, "/ban [playerid] [reason]"); 
	if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "That player is not connected");
	mysql_format(BansDB, query, sizeof(query), "INSERT INTO `bans` (`Username`, `BannedBy`, `BanReason`, `IpAddress`, `Date`) VALUES ('%e', '%e', '%e', '%e', '%e')", playername(giveplayerid), playername(playerid), reason, PlayerIP, ReturnDate());
	mysql_tquery(BansDB, query, "", "");
	format(string, sizeof(string), "SERVER: %s[%d] was banned by %s, Reason: %s", playername(giveplayerid), giveplayerid, playername(playerid), reason);
	SendClientMessageToAll(-1, string);
	pkickbantimer[playerid] = SetTimerEx("KickBanTimer", 1000, 0, "dd", giveplayerid, 2);
	return 1;
}
their is problem with your bracket here too


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 05.09.2018

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
their is problem with ban cmd
it wont work till you replace this with it
Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 4) return 0;
	new PlayerIP[17];
	new giveplayerid, reason[128], string[150], query[700];
	GetPlayerIp(giveplayerid, PlayerIP, sizeof(PlayerIP));
	if(sscanf(params, "us[128]", giveplayerid, reason)) return Usage(playerid, "/ban [playerid] [reason]"); 
	if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "That player is not connected");
	mysql_format(BansDB, query, sizeof(query), "INSERT INTO `bans` (`Username`, `BannedBy`, `BanReason`, `IpAddress`, `Date`) VALUES ('%e', '%e', '%e', '%e'), '%e'", playername(giveplayerid), playername(playerid), reason, PlayerIP, ReturnDate());
	mysql_tquery(BansDB, query, "", "");
	format(string, sizeof(string), "SERVER: %s[%d] was banned by %s, Reason: %s", playername(giveplayerid), giveplayerid, playername(playerid), reason);
	SendClientMessageToAll(-1, string);
	pkickbantimer[playerid] = SetTimerEx("KickBanTimer", 1000, 0, "dd", giveplayerid, 2);
	return 1;
}
Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 4) return 0;
	new PlayerIP[17];
	new giveplayerid, reason[128], string[150], query[700];
	GetPlayerIp(giveplayerid, PlayerIP, sizeof(PlayerIP));
	if(sscanf(params, "us[128]", giveplayerid, reason)) return Usage(playerid, "/ban [playerid] [reason]"); 
	if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "That player is not connected");
	mysql_format(BansDB, query, sizeof(query), "INSERT INTO `bans` (`Username`, `BannedBy`, `BanReason`, `IpAddress`, `Date`) VALUES ('%e', '%e', '%e', '%e', '%e')", playername(giveplayerid), playername(playerid), reason, PlayerIP, ReturnDate());
	mysql_tquery(BansDB, query, "", "");
	format(string, sizeof(string), "SERVER: %s[%d] was banned by %s, Reason: %s", playername(giveplayerid), giveplayerid, playername(playerid), reason);
	SendClientMessageToAll(-1, string);
	pkickbantimer[playerid] = SetTimerEx("KickBanTimer", 1000, 0, "dd", giveplayerid, 2);
	return 1;
}
their is problem with your bracket here too
Do you even know what you are talking about? That works perfectly for me lol


Re: [MYSQL R41-2] Ban / Unban System - CaptainBoi - 05.09.2018

not for me or not for others in r4-4
go check urself
do /ban yourself in game then see localhost/phpymadmin
`bans` u wont see the name their
but after adding mine it will show ur name thier

my work was jsut to report it thats all


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 05.09.2018

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
not for me or not for others in r4-4
go check urself
do /ban yourself in game then see localhost/phpymadmin
`bans` u wont see the name their
but after adding mine it will show ur name thier

my work was jsut to report it thats all
Actually I've just noticed it before. It was working before I added time/date but I realise I put '%e' after the bracket, I've fixed it. Thank you for reporting


Re: [MYSQL R41-2] Ban / Unban System - AlfaSufaIndo - 09.09.2018

When do you think you will finish WAdmin? I really can't wait for that hahaha xD


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 09.09.2018

Quote:
Originally Posted by AlfaSufaIndo
Посмотреть сообщение
When do you think you will finish WAdmin? I really can't wait for that hahaha xD
I've finished all the commands but i'm thinking if i should release it or not, i want to create something unique so it can be more useful for players because there's just admin commands..


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 11.09.2018

^^

WAdmin is Released, but as I said it's not very implemented but still useful, if y'all who asked me to make it want to use, you can find the download link on my signature or by clicking "released". Thank you for your suggestion


Re: [MYSQL R41-2] Ban / Unban System - NoahF - 14.09.2018

Simple and nice for maybe some new servers using MySQL, well done.


Re: [MYSQL R41-2] Ban / Unban System - solstice_ - 14.09.2018

Quote:
Originally Posted by NoahF
Посмотреть сообщение
Simple and nice for maybe some new servers using MySQL, well done.
Thank you