Banning isn't working. -
EliteApple - 16.02.2014
When a player connects with a character that is already ban, it doesn't do nothing.
pawn Код:
new ban[128], DataString[156];
// Banning System
format(ban, sizeof(ban), "SELECT * FROM `bans` WHERE `Username` = '%s'", GetPlayerNameEx(playerid)); // Unbanning IP
mysql_query(ban);
mysql_store_result();
if(mysql_num_rows() >= 1)
{
mysql_fetch_field( "AdminName", DataString);
SendClientMessage(playerid, COLOR_RED, ".::. Account Ban .::.");
format(ban, sizeof(ban), "Username: %s", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_WHITE, ban);
format(ban, sizeof(ban), "Admin: %s", DataString);
SendClientMessage(playerid, COLOR_WHITE, ban);
mysql_fetch_field( "BanReason", DataString);
format(ban, sizeof(ban), "Reason: %s", DataString);
SendClientMessage(playerid, COLOR_WHITE, ban);
mysql_fetch_field( "Date", DataString);
format(ban, sizeof(ban), "Date: %s", DataString);
SendClientMessage(playerid, COLOR_WHITE, ban);
SetTimer("ban", 5000, false);
return 1;
}
I'm not sure why, either. I probably have the selecting wrong honestly, but I'm not to sure, mysql num rows isnt even called.
Re: Banning isn't working. -
FreakyFlan1990 - 16.02.2014
Show us mysql logs.
Re: Banning isn't working. -
EliteApple - 16.02.2014
The logs from that -
Quote:
[02/16/14 09:25:46] Function: 'mysql_query' executed: "SELECT * FROM `bans` WHERE `Username` = 'Raul Mendoza'" with result: "0".
[02/16/14 09:25:46] Function: 'mysql_num_rows' called with result: "0".
|
Re: Banning isn't working. -
EliteApple - 18.02.2014
BUMP
Re: Banning isn't working. -
Pottus - 18.02.2014
Looks like your GetPlayerNameEx() removes part of their name Raul Mendoza Raul_Mendoza
Re: Banning isn't working. -
PowerPC603 - 19.02.2014
Also:
pawn Код:
SetTimer("ban", 5000, false);
What should this timer do?
If you want to ban this player (or kick him from the server), you need SetTimerEx and supply the playerid to it:
pawn Код:
SetTimerEx("ban", 5000, false, "i", playerid);
But first make sure your name is in the "Bans" table and also check, as Pottus said, that your function is returning the correct name.
Names cannot have spaces in them.
Re: Banning isn't working. -
GamemodeRP123 - 19.02.2014
RCON Loggin and ban them
__________________________________________________ ____
Come here new special Server, very good you will be
shock when seeing this new RP server...
HostName: [ENG]Future Generation Gaming[0.3x R2]
Address: 75.71.205.53:7777
Players: 4 / 250
Ping: 632
Mode: Roleplay FGG v3.5b
Map: Los Angeles
Really good RP need to try!
Re: Banning isn't working. -
itsCody - 19.02.2014
are you checking if they're banned upon connecting?