SA-MP Forums Archive
chatlogs - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: chatlogs (/showthread.php?tid=74307)



chatlogs - MarkusJuntunen - 21.04.2009

Код:
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)


Re: chatlogs - MarkusJuntunen - 21.04.2009

Help.


Re: chatlogs - MenaceX^ - 21.04.2009

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

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



Re: chatlogs - MarkusJuntunen - 21.04.2009

Thanks for answer, works like a charm :P


Re: chatlogs - Francis[French] - 21.04.2009

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


Re: chatlogs - MenaceX^ - 21.04.2009

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);



Re: chatlogs - Weirdosport - 21.04.2009

But Log isn't standard is it?


Re: chatlogs - MenaceX^ - 21.04.2009

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