File save problem
#1

Well i made a anti advertise and it also logs in a .txt. The problem is if another person ad's, it will create the text on the same line, i want that it will create a new line on the .txt
pawn Код:
new File:pos=fopen("Advertisers.txt", io_append);
            format(str,sizeof(str),"%s: %s (%s %d, %d : %d)",Nam,text,Months[bmonth - 1],bday,bhour,bminute);
            fwrite(pos, str);
            fclose(pos);
Reply
#2

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Well i made a anti advertise and it also logs in a .txt. The problem is if another person ad's, it will create the text on the same line, i want that it will create a new line on the .txt
pawn Код:
new File:pos=fopen("Advertisers.txt", io_append);
            format(str,sizeof(str),"%s: %s (%s %d, %d : %d)",Nam,text,Months[bmonth - 1],bday,bhour,bminute);
            fwrite(pos, str);
            fclose(pos);
pawn Код:
new File:pos=fopen("Advertisers.txt", io_append);
            format(str,sizeof(str),"%s: %s (%s %d, %d : %d)\n",Nam,text,Months[bmonth - 1],bday,bhour,bminute);
            fwrite(pos, str);
            fclose(pos);
Try that and tell me if it works.
Reply
#3

ddnbb code will not work too.

try doing this

pawn Код:
format(str,sizeof(str),"%s: %s (%s %d, %d : %d)\r\n",Nam,text,Months[bmonth - 1],bday,bhour,bminute);
hope it work
Reply
#4

i forgot about using \n lol. Thank you ddnbb, repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)