[FilterScript] [MYSQL R41-2] Ban / Unban System
#21

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

true
Reply
#22

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

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.
Reply
#24

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
Reply
#25

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
Reply
#26

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
Reply
#27

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
Reply
#28

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
Reply
#29

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

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..
Reply
#31

^^

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
Reply
#32

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)