line isnt deleted
#1

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
Reply
#2

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;
}
Reply
#3

doesnt work
Reply
#4

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

Maybe you need io_append
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)