Different log per each player
#1

Hello, i know this would sound impossible but i need to know if there is a way to create a single file log for every single player and every single action they do.

Something like:

[CHAT]LoggedPlayer: hi
[PM]LoggedPlayer:

And so on.

Is possible?
Reply
#2

Join Date: Jan 2010
Posts: 2,859
Reputation: 180
Scripting for $$ - Pm me for more info.

And you are asking is that posible? Of course it is, and it's very easy, just think about it a little......
Reply
#3

Create stock LogPlayerAction or something, name the file after the playername and write your logs.
Reply
#4

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Create stock LogPlayerAction or something, name the file after the playername and write your logs.
I'll try.

Quote:
Originally Posted by Dragony92
Посмотреть сообщение
Join Date: Jan 2010
Posts: 2,859
Reputation: 180
Scripting for $$ - Pm me for more info.

And you are asking is that posible? Of course it is, and it's very easy, just think about it a little......
I know it's very easy because i tried and i wanna know if there are different ways then mine.
Reply
#5

Yes you can, but it will consume alot of space.
OnPlayerText should take care of the PMs and chat, and you could get the executed commands via OnPlayerCommandReceived.
After that comes the saving part.
Reply
#6

Quote:
Originally Posted by Face9000
Посмотреть сообщение
Hello, i know this would sound impossible but i need to know if there is a way to create a single file log for every single player and every single action they do.
Is possible?
Quote:
Originally Posted by Face9000
Посмотреть сообщение
I know it's very easy because i tried and i wanna know if there are different ways then mine.
? Lol
Reply
#7

Like this perhaps?
PHP код:
OnPlayerText()
{
      
LogPlayer(playeridstring); // Use this in OnPlayerCommandText too
}
LogPlayer(playeridstr[])
{
     new 
log[200]; 
     new 
ddmmyysecminhr;
     new 
pname[MAX_PLAYER_NAME];
     
GetPlayerName(playeridpname25);
     new 
filepath[40];
     
format(filepathsizeof(filepath), "%s.log"pname);
     new 
FilefileHandle fopen(filepathio_append);
     
getdate(yymmdd);
     
gettime(hrminsec);
     
format(logsizeof(log), "[%i/%i/%i - %i:%i:%i] %s\r\n"ddmmyyhrminsecstr);
     
fwrite(fileHandlelog);
     
fclose(fileHandle);
     return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)