12.03.2011, 20:28
I made this simple script for my server. CODE:
It creates the file and stuff. It just wont write to the file. What do
pawn Код:
public OnPlayerText(playerid, text[])
{
new File:chatlog = fopen("/logs/chatlog.txt",io_append),chat[128],chater[128],hour,minute,second;
GetPlayerName(playerid,chater,sizeof(chater));
gettime(hour,minute,second);
format(chat,sizeof(chat),"[%d:%d:%d]: ( %s ): %s\n",hour,minute,second,chater,text);
if(chatlog)
{
if(fexist("chatlog.txt"))
{
fwrite(chatlog,chat);
fclose(chatlog);
}
}
return 1;
}