SA-MP Forums Archive
line isnt deleted - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: line isnt deleted (/showthread.php?tid=145195)



line isnt deleted - Cank - 01.05.2010

hi, i have a problem:

Код:
dcmd_delcp(playerid, params[])
{
#pragma unused params
	if(!gRacerInfo[playerid][isracebuild])
	  return SendClientMessage(playerid, COLOR_RED1, "Du erstellst gerade kein Rennen!");
	else
	{
	  new string[100];
	  DisablePlayerRaceCheckpoint(playerid);
	  buildcps--;
	  new File:race=fopen(CheckpointFile, io_read);
	  while(fread(race, string))
		{
			if(!strcmp(string, racestring, true, strlen(racestring)))
			{
			  fclose(race);
	  		fdeleteline(CheckpointFile, string);
	  		SendClientMessage(playerid, COLOR_RED1, "Checkpoint gelцscht!");
			}
		}
	}
	return 1;
}
when i use the cmd, it doesnt delete the line


Re: line isnt deleted - [MWR]Blood - 01.05.2010

You missed a brace
pawn Код:
dcmd_delcp(playerid, params[])
{
#pragma unused params
    if(!gRacerInfo[playerid][isracebuild])
      return SendClientMessage(playerid, COLOR_RED1, "Du erstellst gerade kein Rennen!");
}
    else
    {
      new string[100];
      DisablePlayerRaceCheckpoint(playerid);
      buildcps--;
      new File:race=fopen(CheckpointFile, io_read);
      while(fread(race, string))
        {
            if(!strcmp(string, racestring, true, strlen(racestring)))
            {
              fclose(race);
            fdeleteline(CheckpointFile, string);
            SendClientMessage(playerid, COLOR_RED1, "Checkpoint gelцscht!");
            }
        }
    }
    return 1;
}



Re: line isnt deleted - Cank - 01.05.2010

doesnt work


Re: line isnt deleted - CAR - 01.05.2010

new File:race=fopen(CheckpointFile, io_read);

Maybe you need io_append