Save players logs
#1

Hi everyone,
I'm trying to make a log system to track player.

Now the question: is better save this information on a table in the database or writing into a simple text file?

I have to share this data with the game and the website, which is better?

Thanks in advance.
Reply
#2

I write it in a file, don't see why I should save it in a mysql table.

PHP код:
function KickLog(string[])
{
    new
        
entry128 ],
        
year,
        
month,
        
day,
        
hour,
        
minute,
        
second
    
;
    
getdate(yearmonthday);
    
gettime(hourminutesecond);
    
format(entrysizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",stringdaymonthyearhourminutesecond);
    new 
File:hFile;
    
hFile fopen("Basic/logs/KickLog.log"io_append);
    
fwrite(hFileentry);
    
fclose(hFile);

Use KickLog(string); under a format, example.
PHP код:
format(stringsizeof(string), "x has kicked y", ...);
SendClientMessage(playerid, -1string);
KickLog(string); 
Reply
#3

If you want to show the logs in your website, You gotta save it with MySQL.
Even though if you don't want to show it in your website, I always prefer MySQL for saving stuff.
Reply
#4

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
I write it in a file, don't see why I should save it in a mysql table.

PHP код:
function KickLog(string[])
{
    new
        
entry128 ],
        
year,
        
month,
        
day,
        
hour,
        
minute,
        
second
    
;
    
getdate(yearmonthday);
    
gettime(hourminutesecond);
    
format(entrysizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",stringdaymonthyearhourminutesecond);
    new 
File:hFile;
    
hFile fopen("Basic/logs/KickLog.log"io_append);
    
fwrite(hFileentry);
    
fclose(hFile);

Use KickLog(string); under a format, example.
PHP код:
format(stringsizeof(string), "x has kicked y", ...);
SendClientMessage(playerid, -1string);
KickLog(string); 
Even if I have to show on the website?



Quote:
Originally Posted by oMa37
Посмотреть сообщение
If you want to show the logs in your website, You gotta save it with MySQL.
Even though if you don't want to show it in your website, I always prefer MySQL for saving stuff.
Saving into database every time that a player gives a weapon or pays someone.. doesn't create too much lag?
And this amount of data stored into the database isn't a problem?
Reply
#5

Quote:
Originally Posted by pollo97
Посмотреть сообщение
Saving into database every time that a player gives a weapon or pays someone.. doesn't create too much lag?
And this amount of data stored into the database isn't a problem?
No, Not at all.
I used to save every single thing that player do in my server and everything was normal, That's what MySQL used for.
Reply
#6

Well, you gotta use MySQL if you want to show them on a website, I don't want to show the logs on a website so I don't use MySQL.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)