Why isn't this working? - 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: Why isn't this working? (
/showthread.php?tid=662268)
Why isn't this working? -
aKnoxx - 27.12.2018
I'm getting the SendClientMessage... That part is working. But the fwrite(openedfile, str); part won't work. I open the file and there is nothing written there.
PHP код:
if(dialogid == DIALOG_BUGREPORT)
{
if(response)
{
SendClientMessage(playerid, SCMCOLOR, "Thank you! Your bug report has been saved for our development team to see.");
new name[MAX_PLAYER_NAME], str[280];
GetPlayerName(playerid, name, sizeof(name));
new File:openedfile = fopen("feedback.txt", io_append);
format(str, sizeof(str), "Player Name: %s\n\n", name);
fwrite(openedfile, str);
return 1;
}
}
Re: Why isn't this working? -
Jefff - 27.12.2018
fclose(openedfile); after fwrite
Re: Why isn't this working? -
Logic_ - 27.12.2018
Why the default IO file system... There are other better alternatives already.
And shouldn't you utilize discord or forum for the bug reports because that's how you can properly manage it. This helps users to not report the same bug/ suggest over without knowing.
Re: Why isn't this working? -
aKnoxx - 27.12.2018
Quote:
Originally Posted by Logic_
Why the default IO file system... There are other better alternatives already.
And shouldn't you utilize discord or forum for the bug reports because that's how you can properly manage it. This helps users to not report the same bug/ suggest over without knowing.
|
I'm just scripting random crap to learn xD What alternatives are there that I can use though?
Re: Why isn't this working? -
aKnoxx - 27.12.2018
Quote:
Originally Posted by Jefff
fclose(openedfile); after fwrite
|
tyvm + repped
Do you also know how I can add a line break to the txt file? I used \n\n but that doesn't work.
Re: Why isn't this working? -
Jefff - 27.12.2018
\r\n