Ban system help?
#1

pawn Код:
stock fPermanentUnban(playerid, name[], reason[])
{
    new szBan[64];
    new File:pBans = fopen("Bans/pBans.cfg", io_read);
    while(fread(pBans, szBan)) {
        if(strcmp(szBan, name, true) == 0) {
            printf("Permanent unban: %s has been unbanned successfully.", name);
            format(szBan, sizeof(szBan), "[aCmd]: %s has been unbanned by %s, reason: %s.", GetPlayerNameEx(playerid), name, reason);
            adminSendMessage(COLOR_LIGHTRED, szBan);
            fwrite(pBans, "");
        }
        else {
            printf("Permanent unban: %s could not be found in the ban system.", name);
            SendClientMessage(playerid, COLOR_LIGHTRED, "Error, that name was not found in the ban file.");
        }
    }
    fclose(pBans);
}
Okay, I have made this so far, it find's the name etc - But how can I make it remove that line with the name?
All ban's go into the same file, so it's like this;
"My name" - new line "another name"
So, is there a way to do this? ;3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)