[Help - MySQL] Offline Ban not working
#1

I have this

PHP код:
CMD:oban(playeridparams[])// Banning offline players
{
    new 
bannedAdminName[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], str[128], reason[32], query[128], rows;
    
GetPlayerRPName(playeridAdminNamesizeof(AdminName));
    
GetPlayerName(bannedPlayerNamesizeof(PlayerName));
    if(
PlayerInfo[playerid][Admin] > 3)
    {
        if(
sscanf(params"s[24]"PlayerNamereason)) return SendClientMessage(playeridCOLOR_DARKCORAL"USAGE: /o(ffline)ban [Player NAME] [Reason]");
        
cache_get_row_count(rows);
        if(
rows 0)
        {
            
mysql_format(g_Sqlquerysizeof(query), "UPDATE `accounts` SET `isBanned` = 1 WHERE `Name` = '%e'"PlayerName);
            
mysql_tquery(g_Sqlquery"""");
            
format(strsizeof(str), "%s has offline banned %s. Reason: %s"AdminNamePlayerNamereason);
            
SendClientMessageToAll(COLOR_DARKCORALstr);       
        }
        else
        {
            
SendClientMessage(playeridCOLOR_DARKCORAL"That player doesn't exist!");
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_DARKCORAL"You cannot use this command!");
    }
    return 
1;

When I use this in-game I get: That player doesn't exist!, even though they are in my database



SOLVED BY X337
Reply


Messages In This Thread
[SOLVED by X337] Offline Ban not working - by Sibuscus - 21.03.2017, 18:26
Re: [Help - MySQL] Offline Ban not working - by verlaj - 21.03.2017, 18:50
Re: [Help - MySQL] Offline Ban not working - by AndySedeyn - 21.03.2017, 18:53
Re: [Help - MySQL] Offline Ban not working - by Vince - 21.03.2017, 19:15
Re: [Help - MySQL] Offline Ban not working - by Sibuscus - 22.03.2017, 12:46
Re: [Help - MySQL] Offline Ban not working - by X337 - 22.03.2017, 13:04
Re: [Help - MySQL] Offline Ban not working - by Sibuscus - 22.03.2017, 13:16
Re: [Help - MySQL] Offline Ban not working - by X337 - 22.03.2017, 13:23
Re: [Help - MySQL] Offline Ban not working - by Sibuscus - 22.03.2017, 18:35

Forum Jump:


Users browsing this thread: 2 Guest(s)