pm log problem - 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: pm log problem (
/showthread.php?tid=436153)
pm log problem -
BossZk - 10.05.2013
In the logs it saves in a straight line, for example : "pm from bob(1):gfdf pm to max(2):gdjdkjdad"
i want it to use a new line for every pm, example:
Pm from bob(1): blahblah
Pm to max(2): blahblah
probably an easy fix for you guys
PHP код:
forward PMLog(string[]);
PHP код:
public PMLog(string[])
{
new pm[128]; // Creates a new string
format(pm, sizeof(pm), "%s\n", string); // Formats the string;
new File:hFile; // Creates a new variable with type File
hFile = fopen("/LOGS/pm.log", io_append); // Opens the Log File
fwrite(hFile, pm); // Writes the log
fclose(hFile); // Closes file
}
Re: pm log problem -
Lordzy - 10.05.2013
pawn Код:
stock PMLog(str[])
{
new File:pf = fopen ("/Logs/pm.log", io_append);
new string[128];
format(string, sizeof(string), "%s\r\n", str);
if(pf)
{
fwrite(pf, str);
fclose(pf);
}
return 1;
}
Re: pm log problem -
BossZk - 10.05.2013
that didnt work bro, makes the msg on the same line and its cut off the name and id of the sender, if i send my pm command would that help?
Re: pm log problem -
Joe Staff - 10.05.2013
What are you opening the file with? Notepad doesn't read '\n' properly. Wordpad will, but do NOT save because it will alter the file.
Re: pm log problem -
BossZk - 11.05.2013
i am opening it with notepad, so theres no way it could work with notepad?
EDIT: tried with textpad also, its the same way as the notepad
Re: pm log problem -
BossZk - 14.05.2013
any other solutions?