Y_INI RemoveEntry Issue
#1

Any idea why this command won't remove the player's file from ...scriptfiles/jAdmin/Accounts ?
pawn Code:
YCMD:ban(params)
{
    if(help) return SCM(playerid, HELP,"[Ban] With this command you can ban a player");
    new id, name2[MAX_PLAYER_NAME], str[128], reason[35], file[30];
    if(sscanf(o,"us[35]", id, reason)) return SCM(playerid, GREY,"Syntax Error: /ban [PlayerName/ID] [Reason]");
    if(id == INVALID_PLAYER_ID) return SCM(playerid, GREY,"This player is offline");
    GetPlayerName(id, name2, sizeof(name2));
    format(file,sizeof(file),"/jAdmin/Accounts/%s.ini",name2);
    new INI:File = INI_Open(file);
    INI_RemoveEntry(File, file);
    INI_Close(File);
    format(str, sizeof(str),"banip %s", GetIP(id));
    SendRconCommand(str);
    Ban(id);
    #if SAVE_LOGS == true
    DATE;
    format(str, sizeof(str),"%s has been banned for %s on date %d/%d/%d", name2, reason, y,m,d);
    BanLog(str);
    #endif
    return 1;
}
Reply
#2

Is there any function I can remove the whole .ini file?
Reply
#3

Quote:
Originally Posted by Y_Less
View Post
Yes - fremove!
Okay, I did this, but it still doesn't delete the file.
pawn Code:
YCMD:ban(params)
{
    if(help) return SCM(playerid, HELP,"[Ban] With this command you can ban a player");
    new id, name2[MAX_PLAYER_NAME], str[128], reason[35], file[30];
    if(sscanf(o,"us[35]", id, reason)) return SCM(playerid, GREY,"Syntax Error: /ban [PlayerName/ID] [Reason]");
    if(id == INVALID_PLAYER_ID) return SCM(playerid, GREY,"This player is offline");
    GetPlayerName(id, name2, sizeof(name2));
    format(file,sizeof(file),"/jAdmin/Accounts/%s.ini",name2);
    fremove(file);
    format(str, sizeof(str),"banip %s", GetIP(id));
    SendRconCommand(str);
    Ban(id);
    #if SAVE_LOGS == true
    DATE;
    format(str, sizeof(str),"%s has been banned for %s on date %d/%d/%d", name2, reason, y,m,d);
    BanLog(str);
    #endif
    return 1;
}
Reply
#4

Tried with "path" instead of "/path" but it still doesn't remove the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)