Help With My Chat Log
#4

AlecRae,

1. Create file "Server Floder/scriptfiles/Logs/Chatlog.txt"

2. Install complete chat log script (did not test):

pawn Код:
#include <a_samp>

//--Defines
#define ChatL "Logs/Chatlog.txt" //server floder/scriptfiles..

public OnPlayerText(playerid, text[]) //by illay
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"%s: %s",name,text);
  WriteLog(ChatL,string); //+ Time
    return 1;
}

//--Functions
stock WriteLog(const file[],const text[]) //by Goldkiller
{
    new
        c[128],
        time[2],
        File:cFile=cFile=fopen(file, io_append);
    if(!cFile) return 0;
    gettime(time[0],time[1]);
    format(c,sizeof(c),"[%02d:%02d] %s\r\n",time[0],time[1],text);
    fwrite(cFile,c);
    fclose(cFile);
    return 1;
}
One line in Chatlog: [Time] playerid (name): Text
Reply


Messages In This Thread
Help With My Chat Log - by Alec24 - 29.03.2009, 14:37
Re: Help With My Chat Log - by FUNExtreme - 29.03.2009, 14:38
Re: Help With My Chat Log - by Pyrokid - 29.03.2009, 14:41
Re: Help With My Chat Log - by illay - 29.03.2009, 14:55
Re: Help With My Chat Log - by FUNExtreme - 29.03.2009, 14:55
Re: Help With My Chat Log - by illay - 29.03.2009, 14:58
Re: Help With My Chat Log - by FUNExtreme - 29.03.2009, 14:59
Re: Help With My Chat Log - by Alec24 - 29.03.2009, 15:02
Re: Help With My Chat Log - by FUNExtreme - 29.03.2009, 15:05
Re: Help With My Chat Log - by illay - 29.03.2009, 15:05

Forum Jump:


Users browsing this thread: 6 Guest(s)