pm log problem
#1

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(pmsizeof(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(hFilepm); // Writes the log
    
fclose(hFile); // Closes file

Reply
#2

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

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?
Reply
#4

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.
Reply
#5

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

any other solutions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)