SA-MP Forums Archive
Help! Save InputText to a file - 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)
+--- Thread: Help! Save InputText to a file (/showthread.php?tid=563332)



Help! Save InputText to a file - Pikni95 - 15.02.2015

Hi, how can i fix it this warning: warning 213: tag mismatch (at line 53/54/55)
Код:
#include <a_samp>
#include <ZCMD>

stock AddLogLine( field[ ], file[ ], input[ ] )
{
    new string[128];
    format(string, 128, "%s: %s\r\n", field, input);

    new File:fhandle;

    if(fexist(file)) {
        printf("Creating file '%s' because theres no file created with that name.", file);
    }

    fhandle = fopen(file,io_append);

    fwrite(fhandle,string);
    fclose(fhandle);
    return 1;
}

stock WriteLog(file[], input[])
{
	File:filevar;
	if(!fexist(file)) filevar = fopen(file, io_write);
	else filevar = fopen(file, io_append);
	if(!fexist(file))
	{
		printf("Failed to load '%s'", file);
		return 0;
	}
	else
	{
		new str[512];
		format(str, sizeof(str), "%s\r\n", input);
		fwrite(filevar, input);
		fclose(filevar);
		return 1;
	}
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 181 && response == 1)
	{
		new string[256];
		if(!fexist("DataBase.txt"))
		{
			new File:create = fopen("DataBase.txt", io_write);
			fclose(create);
		}
		format(string, sizeof(string), "%s\r\n", inputtext);
		new Fike:pos=fopen("DataBase.txt", io_append);
		fwrite(pos, string);
		fclose(pos);
	}
	return 1;
}

COMMAND:myemail(playerid, params[])
{
	ShowPlayerDialog(playerid, 181, DIALOG_STYLE_INPUT, "DataBase Registering", "{CACA11}Insert your mail!\n{108XII}Type your mail and pres Ok", "Ok", "");
	return 1;
}
Lines error:
Код:
		new Fike:pos=fopen("DataBase.txt", io_append);
		fwrite(pos, string);
		fclose(pos);



Re: Help! Save InputText to a file - Vince - 15.02.2015

Do you even read? Fike? Really?


Re: Help! Save InputText to a file - Pikni95 - 15.02.2015

Fike ---> File Thanks bro