chatlogs
#1

Код:
public OnPlayerText(playerid, text[])
{
new File:gfile, filename[MAX_PLAYER_NAME + 4];
GetPlayerName(playerid, filename, MAX_PLAYER_NAME);
format(filename, sizeof filename, "%s.log", filename);
if(!fexist(filename)) gfile = fopen(filename, io_write);
else gfile = fopen(filename, io_append);
fwrite(text), fclose(gfile);
return 1;
}
Error:
C:\Documents and Settings\Annika Peter.DITT-4C077CBAAE\Mina dokument\Pawno\pawno\COD5.pwn(114) : error 035: argument type mismatch (argument 1)
Reply
#2

Help.
Reply
#3

fwrite writes onto a file, but it should write something of course.

pawn Код:
fwrite(gfile,text);
Reply
#4

Thanks for answer, works like a charm :P
Reply
#5

Hi there,

By the way, this will create a log file for EVERY user that talks. Meaning that if I say "Hi", it will print out "Hi" in "[SAP]Francis.log". Then, if I say "How are you?", the file will now look like that: "HiHow are you?". You can fix this by adding "\n" after the text you want to write. (Or just add "fwrite(gfile, "\n");" after your other "fwrite" line.)

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com
Reply
#6

In my mode I just do this..
pawn Код:
format(string,sizeof(string),"OnPlayerText             %s %s (%d:%d:%d %d/%d/%d IP:%s)",pInfo[playerid][pname],text,hour,mins,sec,day,month,year,pInfo[playerid][ip]);
  Log("OnPlayerText.txt",string);
Reply
#7

But Log isn't standard is it?
Reply
#8

Quote:
Originally Posted by Weirdosport
But Log isn't standard is it?
Nope, my function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)