31.05.2011, 14:40
Hey guys. Can someone tell me why this doesnt work?
Thank you.
pawn Код:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME], File:chatlog[128];
GetPlayerName(playerid, name, sizeof(name));
format(chatlog, sizeof(chatlog), "Logs/Chat/%s.txt", name);
fopen(chatlog, io_readwrite);
new chat[128], chater[128], day, month, year, hour, minute, second;
GetPlayerName(playerid,chater,sizeof(chater));
gettime(hour, minute, second);
getdate(year, month, day);
format(chat,sizeof(chat),"[%d/%d %d %d:%d:%d]: ( %s ): %s\n", day, month, year, hour, minute, second, chater, text);
if(chatlog)
{
if(fexist(chatlog))
{
fwrite(chatlog,chat);
fclose(chatlog);
}
}
return 1;
}