Mysql Delete data...
#2

PHP код:
CMD:unban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pBanAppealer] >= 1)
    {
        new 
string[128];
        if(
isnull(params)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /unban [playername]");
        if(
doesAccountExist(params))
        {
            
OnPlayerOfflineLogin(params);
            if( 
PlayerInfo[MAX_PLAYERS][pPermaBanned] == )
            {
                
SendClientMessageExplayeridCOLOR_WHITE"Permanently banned accounts can only be unbanned via FTP." );
            }
            else
            {
                if( 
PlayerInfo[MAX_PLAYERS][pBanned] >= 0)
                {
                    
PlayerInfo[MAX_PLAYERS][pBanned] = 0;
                    
PlayerInfo[MAX_PLAYERS][pWarns] = 0;
                    
PlayerInfo[MAX_PLAYERS][pDisabled] = 0;
                    
RemoveBan(PlayerInfo[MAX_PLAYERS][pIP]);
                    print(
"OnPlayerOfflineLogin: Saving variables to file");
                    
OnPlayerOfflineSave(params);
                    print(
"OnPlayerOfflineLogin: Variables saved properly");
                    
format(string128"AdmCmd: %s (IP:%s) was unbanned by %s."paramsPlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid));
                    
ABroadCast(COLOR_LIGHTRED,string,2);
                    new 
yearmonth,day;
                    new 
query[120];
                    
format(query,sizeof(query),"DELETE FROM `bans` WHERE `name` = '%s'",params);
                    
mysql_query(query, [Your mysql databse name]);
                    
getdate(yearmonthday);
                    
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was unbanned by %s. (%d-%d-%d)"paramsPlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid),month,day,year);
                    
Log("logs/ban.log"string);
                    print(string);
                }
                else
                {
                    
SendClientMessageExplayeridCOLOR_WHITE"Not a banned account!" );
                }
            }
        }
        else
        {
            
SendClientMessageExplayeridCOLOR_WHITE"That account doesn't exist." );
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
    }
    return 
1;

You were missing this.
PHP код:
 new query[120];
                    
format(query,sizeof(query),"DELETE FROM `bans` WHERE `name` = '%s'",params);
                    
mysql_query(query, [Your mysql databse name]); 
And yeah enter your db name after the query,
Reply


Messages In This Thread
Mysql Delete data... - by daghost111 - 29.11.2016, 14:40
Re: Mysql Delete data... - by StrikerZ - 29.11.2016, 14:44
Re: Mysql Delete data... - by daghost111 - 29.11.2016, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)