adding a new line in a file?
#1

Hi, i have made a /report cmd which save the name and the report of the player, but when you use it, it works fine, but if you use it again it just replaces the first line?

So how can you make it add a new line each time?

code:
Код:
dcmd_report(playerid,params[])
{
	new rep[128],name[MAX_PLAYER_NAME],string[128];
	if(sscanf(params,"s",rep)) return SendClientMessage(playerid,COLOUR_RED,"Usage: /report [Bug Report]");
	else
	{
		new File:openfile = fopen("BugReports.ini",io_write);
	  GetPlayerName(playerid,name,sizeof(name));
		format(string,sizeof(string),"%s - %s \n",name,rep);
		fwrite(openfile,string);
		fclose(openfile);
		SendClientMessage(playerid,COLOUR_GREEN,"Bug report has been sent!");
		return 1;
		}
}
Reply


Messages In This Thread
adding a new line in a file? - by Naxix - 15.04.2010, 16:09
Re: dini new line? - by Torran - 15.04.2010, 16:15
Re: dini new line? - by Naxix - 15.04.2010, 16:16
Re: adding a new line in a file? - by Thrarod - 15.04.2010, 16:18
Re: adding a new line in a file? - by Naxix - 15.04.2010, 16:18
Re: adding a new line in a file? - by Naxix - 15.04.2010, 16:22
Re: adding a new line in a file? - by Thrarod - 15.04.2010, 16:24
Re: adding a new line in a file? - by Naxix - 15.04.2010, 16:28
Re: adding a new line in a file? - by Thrarod - 15.04.2010, 16:31
Re: adding a new line in a file? - by Naxix - 15.04.2010, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)