Ban info message not showing -
Face9000 - 07.01.2014
Hello, can someone explain me why this stock that should return ban info message doesn't show at the banned player when he connects?
I have this
pawn Код:
IsPlayerBanned(playerid);
on OnPlayerConnect.
This is the full stock:
pawn Код:
stock IsPlayerBanned(playerid)
{
new IP[16], String[128], Query[128], reason[64], admin[32], i[128], seconds;
GetPlayerIp(playerid, IP, sizeof(IP));
format(Query, sizeof(Query), "SELECT * FROM `Bans` WHERE (`Username` = '%s' OR `IP` = '%s') AND `Banned` = 1 LIMIT 1", GetName(playerid), IP);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row_format(Query, "|"))
{
mysql_fetch_field_row(i, "Reason"); format(reason, sizeof(reason), i);
mysql_fetch_field_row(i, "Seconds"); seconds = strval(i);
mysql_fetch_field_row(i, "Admin"); format(admin, sizeof(admin), i);
}
if(seconds > gettime())
{
format(String, sizeof(String), "Reason: %s", reason);
SendClientMessage(playerid, COLOR_RED, String);
SendClientMessage(playerid, COLOR_RED, "*** You are banned from Battlefield War Heroes ***");
format(String, sizeof(String), "You'll be unbanned in: %s - Until that, don't try to evade ban.", timec(gettime()-(gettime()-seconds)));
SendClientMessage(playerid, COLOR_RED, String);
SendClientMessage(playerid, COLOR_RED, "If you attempt to, you might get rangebanned for trying to 'ban evade.'");
SendClientMessage(playerid, COLOR_RED, "If you feel that you have been unfairly banned, please visit our website to appeal the ban.");
Kick(playerid);
}
else
{
format(Query, sizeof(Query), "UPDATE `Bans` SET `Banned` = 0 WHERE `Username` = '%s'", GetName(playerid));
mysql_query(Query);
}
}
mysql_free_result();
return 1;
}
Thanks for helping.
Re: Ban info message not showing -
MatriXgaMer - 07.01.2014
Nope if player is banned it will not show enything i bealive.
Re: Ban info message not showing -
Face9000 - 07.01.2014
I know but, with dini i managed to show the message. Even with Y_INI i did. So i don't think with MySQL is not possible. Also i've seen this in few servers too. You join (with your banned account) and you get the message.
Re: Ban info message not showing -
MatriXgaMer - 07.01.2014
Don't know, ask someone experienced then me
Re: Ban info message not showing -
Face9000 - 07.01.2014
Okay don't worry
Re: Ban info message not showing -
Djole1337 - 07.01.2014
pawn Код:
SetTimerEx("KickPlayer", 250, false, "i", playerid);
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
return Kick(playerid);
}
Re: Ban info message not showing -
Face9000 - 07.01.2014
What this had to do? I have already that variables.
#Edit: Oh, i have to replace the normal kick in that stock. I'll try.
Re: Ban info message not showing -
Face9000 - 07.01.2014
Eh, tested now. Same result.
Re: Ban info message not showing -
HyDrAtIc - 07.01.2014
Set the timer seconds higher and try again.
Respuesta: Re: Ban info message not showing -
Swedky - 07.01.2014
Quote:
Originally Posted by Face9000
Eh, tested now. Same result.
|
Try with 1000 milliseconds:
pawn Код:
SetTimerEx("KickPlayer", 1000, false, "d", playerid);
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
return Kick(playerid);
}