04.09.2018, 17:13
[FilterScript] [MYSQL R41-2] Ban / Unban System
04.09.2018, 19:31
Ah, you forgot the most important thing. You should also save the time/date of the ban. It's really useful.
04.09.2018, 22:09
Quote:
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 |
Yes, actually thought about it today and was planning on updating it, thank you. I've updated it once again, added time/date.
05.09.2018, 09:58
database is not getting created on server on
Edit: replace
to
1 bracket is missing
change the database in script
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");
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)");
change the database in script
05.09.2018, 11:16
their is problem with ban cmd
it wont work till you replace this with it
their is problem with your bracket here too
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; }
05.09.2018, 13:04
Quote:
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; } |
05.09.2018, 13:31
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
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
05.09.2018, 13:33
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
09.09.2018, 15:09
When do you think you will finish WAdmin? I really can't wait for that hahaha xD
09.09.2018, 19:13
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..
11.09.2018, 15:41
^^
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
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
14.09.2018, 15:15
Simple and nice for maybe some new servers using MySQL, well done.
14.09.2018, 19:53
« Next Oldest | Next Newest »
Users browsing this thread: 5 Guest(s)