30.12.2012, 03:23
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);
}
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