Banning isn't working.
#1

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

Show us mysql logs.
Reply
#3

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".

Reply
#4

BUMP
Reply
#5

Looks like your GetPlayerNameEx() removes part of their name Raul Mendoza Raul_Mendoza
Reply
#6

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

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

are you checking if they're banned upon connecting?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)