14.02.2016, 10:28
Samp-server is already logging everything to a text file ("server_log.txt").
If you want to log anything, just use a printf statement and it's in there.
Normal chat logs automatically to that log-file, so it has no use to create extra code to log it a second time in a different file.
I'm using MySQL to log most of my stuff.
Why?
You can easily filter stuff out.
I have one table that records every player-login.
It records the timestamp when a player logged in, his ID (unique integer that defines this player) and his IP at that time.
When this player would complain that his account has been hacked, I can easily filter out all his logins and check the IP.
If the IP has a different range all of a sudden (usually the last digits could be a little different for this player's main location), you can be sure his account has been hacked from another location.
Using Navicat, you can sort data in a nice table on your screen and use custom SELECT queries to filter out data.
Doing the same using textfiles requires alot more work to find the data you're looking for, unless you have textfiles for every situation and every player separately.
If you want to log anything, just use a printf statement and it's in there.
Normal chat logs automatically to that log-file, so it has no use to create extra code to log it a second time in a different file.
I'm using MySQL to log most of my stuff.
Why?
You can easily filter stuff out.
I have one table that records every player-login.
It records the timestamp when a player logged in, his ID (unique integer that defines this player) and his IP at that time.
When this player would complain that his account has been hacked, I can easily filter out all his logins and check the IP.
If the IP has a different range all of a sudden (usually the last digits could be a little different for this player's main location), you can be sure his account has been hacked from another location.
Using Navicat, you can sort data in a nice table on your screen and use custom SELECT queries to filter out data.
Doing the same using textfiles requires alot more work to find the data you're looking for, unless you have textfiles for every situation and every player separately.

