Deleting a file
#7

Quote:
Originally Posted by Steven82
Посмотреть сообщение
If you have done tests, post your logs of the tests. Post everything that you are using to "test" this theory. Because i also use fremove, and have no trouble with it.
I'm also not the best coder in the world, so it definitely could have been a coding error on my end, it seems to work with my changename command.. Hmm, alright.

pawn Код:
CMD:changename(playerid, params[])
{
    new
        accNewName[MAX_PLAYER_NAME],
        accOldName[MAX_PLAYER_NAME],
        accChanged,
        accStr[128]
    ;
   
    if(sscanf(params, "us[MAX_PLAYER_NAME]", accChanged, accNewName))
        return SendClientMessage(playerid, -1, ""#LIME"<CMD USAGE> "#WHITE"/changename <player id> <new name>");
   
    if( accLogged[accChanged] == false )
        return SendClientMessage(playerid, c_RED, "» #"WHITE"That user is not logged in!");
       
    GetPlayerName(accChanged, accOldName, sizeof(accOldName));
   
    fremove(find_accPath(accChanged));
   
    SetPlayerName(accChanged, accNewName)
       
    new
        INI:accFile = INI_Open(find_accPath(accChanged) ),
        accIP[16],
        Float:Position[4],
        adminName[MAX_PLAYER_NAME]
    ;
               
    GetPlayerIp(accChanged, accIP, sizeof(accIP))
    GetPlayerPos(accChanged, Position[0], Position[1], Position[2]);
    GetPlayerFacingAngle(accChanged, Position[3]);
   
    GetPlayerName(playerid, adminName, sizeof(adminName));
               
    INI_SetTag(accFile, "data");
       
    INI_WriteInt(accFile, "Passcode", accInfo[accChanged][Passcode] );
    INI_WriteString(accFile, "RegisteredIP", accIP);
    INI_WriteInt(accFile, "Authorization", accInfo[accChanged][Authorization]);
    INI_WriteString(accFile, "PreviousName", accOldName);
       
    INI_WriteInt(accFile,   "Funds",        accInfo[accChanged][Funds]);
    INI_WriteInt(accFile,   "BankFunds",    accInfo[accChanged][BankFunds]);
           
    INI_WriteInt(accFile,   "SkinModel",    accInfo[accChanged][SkinModel]);
           
    INI_WriteInt(accFile,   "Kills",        accInfo[accChanged][Kills]);
    INI_WriteInt(accFile,   "Deaths",       accInfo[accChanged][Deaths]);
           
    INI_WriteInt(accFile,   "EventsWon",    accInfo[accChanged][EventsWon]);
           
    INI_WriteFloat(accFile, "X_Pos",        Position[0]);
    INI_WriteFloat(accFile, "Y_Pos",        Position[1]);
    INI_WriteFloat(accFile, "Z_Pos",        Position[2]);
    INI_WriteFloat(accFile, "Ang_Pos",      Position[3]);
           
    INI_Close(accFile);
   
    format(accStr, sizeof(accStr), ""#CYAN"» "#WHITE"You have edited %s's name. Old Name: %s, New Name: %s", accOldName, accOldName, accNewName);
    SendClientMessage(playerid, -1, accStr);
   
    format(accStr, sizeof(accStr), ""#CYAN"» "#WHITE"Your name has been edited. Old Name: %s, New Name: %s", accOldName, accNewName);
    SendClientMessage(accChanged, -1, accStr);
   
    format(accStr, sizeof(accStr), ""#CYAN"» Administrator %s has edited %s's name to %s.", adminName, accOldName, accNewName);
    SendAdminMessage(1, accStr);
    return true;
}
Reply


Messages In This Thread
Deleting a file - by 2KY - 12.02.2012, 20:44
Re: Deleting a file - by Ash. - 12.02.2012, 20:52
Re: Deleting a file - by 2KY - 12.02.2012, 20:53
Re: Deleting a file - by Ash. - 12.02.2012, 21:01
Re: Deleting a file - by 2KY - 12.02.2012, 21:02
Re: Deleting a file - by Steven82 - 12.02.2012, 21:04
Re: Deleting a file - by 2KY - 12.02.2012, 21:08

Forum Jump:


Users browsing this thread: 3 Guest(s)