Delete Account from MySQL not work?!
#1

I made a admin command to delete player account offline. Yeah, I'm having a trouble on the code, when I use the command, it always say that "can't find account" although I fill the account name correctly.
PHP код:
CMD:delaccount(playeridparams[]){
    new 
aName[MAX_PLAYER_NAME], szFieldName[MAX_PLAYER_NAME], query[256], string[128];
    if(
Character[playerid][Admin] < 4) return System_Scm(playerid"You do not have permission to perform this command."TYPE_ERROR);
    if(
sscanf(params"s[24]"aName)) return System_Scm(playerid"/delaccount [Account Name]"TYPE_NOTICE);
    foreach(new 
iPlayer){
        if(!
strcmp(aNameGetPlayerNameEx(playerid))) {
            
format(stringsizeof(string), "Account [%s] is being used by Player ID [%d]"aNamei);
            
System_Scm(playeridstringTYPE_ERROR);
            return 
1;
        } 
    }
    new 
rows;
    
cache_get_row_count(rows);
    for(new 
row 0row rowsrow++){
        
cache_get_value_name(row"Username"szFieldName24);
        
printf("%s - %s"aNameszFieldName);
        if(!
strcmp(aNameszFieldName)) {
            
mysql_format(MHandlequerysizeof(query), "DELETE FROM `character` WHERE (`Username` = '%e') LIMIT 1"aName);
            
mysql_query(MHandlequery);
            
format(stringsizeof(string), "[%s] deleted [%s]"GetPlayerNameEx(playerid), aName);
            foreach(new 
iPlayer) {
                if(
Character[i][Admin] > 0System_Scm(playeridstringTYPE_SUCCESS);
            }
            return 
1;
        }    
    }
    
format(stringsizeof(string), "Can't find account [%s]"aName);
    
System_Scm(playeridstringTYPE_ERROR);
    return 
1;

I am using MySQL R41-2, the lastest version. I really need help!
Reply


Messages In This Thread
[No subject] - by DuyDang2412 - 06.03.2017, 06:57
Re: Delete Account from MySQL not work?! - by XStormiest - 06.03.2017, 08:00
[No subject] - by DuyDang2412 - 06.03.2017, 08:03
Re: Delete Account from MySQL not work?! - by XStormiest - 06.03.2017, 08:10
XStormiest - by DuyDang2412 - 06.03.2017, 08:48
Re: Delete Account from MySQL not work?! - by StrikerZ - 06.03.2017, 09:07
Re: Delete Account from MySQL not work?! - by DuyDang2412 - 06.03.2017, 09:29
Re: Delete Account from MySQL not work?! - by DuyDang2412 - 06.03.2017, 09:31
Re: Delete Account from MySQL not work?! - by Runn3R - 06.03.2017, 13:30

Forum Jump:


Users browsing this thread: 1 Guest(s)