Ban info message not showing
#1

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

Nope if player is banned it will not show enything i bealive.
Reply
#3

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

Don't know, ask someone experienced then me
Reply
#5

Okay don't worry
Reply
#6

pawn Код:
SetTimerEx("KickPlayer", 250, false, "i", playerid);

forward KickPlayer(playerid);
public KickPlayer(playerid)
{
    return Kick(playerid);
}
Reply
#7

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

Eh, tested now. Same result.
Reply
#9

Set the timer seconds higher and try again.
Reply
#10

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)