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


Messages In This Thread
Ban info message not showing - by Face9000 - 07.01.2014, 18:22
Re: Ban info message not showing - by MatriXgaMer - 07.01.2014, 18:23
Re: Ban info message not showing - by Face9000 - 07.01.2014, 18:26
Re: Ban info message not showing - by MatriXgaMer - 07.01.2014, 18:30
Re: Ban info message not showing - by Face9000 - 07.01.2014, 18:33
Re: Ban info message not showing - by Djole1337 - 07.01.2014, 18:51
Re: Ban info message not showing - by Face9000 - 07.01.2014, 18:52
Re: Ban info message not showing - by Face9000 - 07.01.2014, 19:00
Re: Ban info message not showing - by HyDrAtIc - 07.01.2014, 19:03
Respuesta: Re: Ban info message not showing - by Swedky - 07.01.2014, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)