Deleting a file
#1

How do I do it? I hear fremove is VERY faulty. Is there an include that someone recommends to allow me to do so?
Reply
#2

Quote:
Originally Posted by 2KY
Посмотреть сообщение
How do I do it? I hear fremove is VERY faulty. Is there an include that someone recommends to allow me to do so?
I've never had problems with fremove...
Reply
#3

Quote:
Originally Posted by funky1234
Посмотреть сообщение
I've never had problems with fremove...
I've done tests and apparently so have others, and it doesn't delete the file 4/5 times..
Reply
#4

Quote:
Originally Posted by 2KY
Посмотреть сообщение
I've done tests and apparently so have others, and it doesn't delete the file 4/5 times..
I'm yet to experience this issue, and I've been using fremove successfully for around a year now - it rotates raw chat/command logs.
Reply
#5

Quote:
Originally Posted by funky1234
Посмотреть сообщение
I'm yet to experience this issue, and I've been using fremove successfully for around a year now - it rotates raw chat/command logs.
Odd, I'm going on hearsay here, but I hear it doesn't work right. So you've never experienced it? Huh, odd. Alright, I'll use it then. Thanks.
Reply
#6

Quote:
Originally Posted by 2KY
Посмотреть сообщение
I've done tests and apparently so have others, and it doesn't delete the file 4/5 times..
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.
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)