24.12.2016, 11:24
(
Последний раз редактировалось AndreiWow; 24.12.2016 в 11:26.
Причина: Solved
)
How can I log the normal chat? Here is what I use for ban log
And I use this at any thing I want to log in there:
but idk how to log normal chat xD when player talks in game, how can I create a string for what a player say so I can save it in a log?
SOLVED, SORRY
How I did it was:
Код:
function BanLog(string[]) { new entry[ 128 ], year, month, day, hour, minute, second ; getdate(year, month, day); gettime(hour, minute, second); format(entry, sizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",string, day, month, year, hour, minute, second); new File:hFile; hFile = fopen("Basic/logs/BanLog.log", io_append); fwrite(hFile, entry); fclose(hFile); }
Код:
BanLog(string);
SOLVED, SORRY
How I did it was:
Код:
if(IsPlayerConnected(playerid)) { if(realchat) { if(PlayerInfo[playerid][pAccent] == 0) { format(string, sizeof(string), "%s says: %s", RPName(playerid), text); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); ChatLog(string); } else { new accent[20] ; switch(PlayerInfo[playerid][pAccent]) { case 1: accent = "Russian"; case 2: accent = "Italian"; case 3: accent = "Germany"; case 4: accent = "Japanese"; case 5: accent = "French"; case 6: accent = "Spain"; case 7: accent = "China"; case 8: accent = "British"; } format(string, sizeof(string), "%s says: [%s Accent] %s", RPName(playerid), accent, text); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); ChatLog(string); } return 0; } }