hello all , help does not remove two lines, and so on, well, removes one line without any help please what is wrong in the code?
Код:
if(strcmp(cmd, "/unban", true) == 0){
new tmp[64];
tmp = strtok(cmdtext, idx);
new serialid[164];
serialid = tmp;
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF0000AA,"use /unban [serialid]");
if(!fexist("SerialBans.txt")) return SendClientMessage(playerid, 0xFF0000AA, "and server no banned");
new File:sfile = fopen("SerialBans.txt", io_read);
new banstr[512], templine[1024];
while(fread(sfile, banstr)) strcat(templine, banstr);
fclose(sfile);
new index = strfind(templine, serialid);
if(index == -1) return SendClientMessage(playerid, 0xFF0000AA, "serial no found");
strdel(templine, index, index + 40);
sfile = fopen("SerialBans.txt", io_write);
fwrite(sfile, templine);
fclose(sfile);
SendClientMessage(playerid, 0xFFBF00AA, "unban serial number");
new sstring[256];
format(sstring, sizeof(sstring), "{FFFFFF}%s", serialid);
SendClientMessage(playerid, -1, sstring);
}return true;}
You need to give us some info, and show us the errors, and the lines they're occurring on.
it removes only one serial number does not remove the other that's the problem =)