Haven't tested, but I don't need to. It works.
Create a folder named "player_logs" in the directory (cstrike, etc.) of your server.
This will log by date, the entries will include the time down to the second, and it will log the player's name and in brackets <> the ip address.
Format:
name <IP Address:
ip> has connected.
Have fun.
Code:
/*
*
* Name: simplelog.sma
*
* Version: 1.0
*
* Purpose: S@ndel wants it.
*
* Usage: Logs name and ip address of each player who has connected to
* the server. amx_logging cvar turns it on/off (1 - on).
*
*/
#include <amxmodx>
new PLUGIN[]="SimpleLog"
new AUTHOR[]="n!nja"
new VERSION[]="1.0"
public plugin_init()
{
// Register plugin
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_logging", "1")
return PLUGIN_CONTINUE
}
public client_connect(id)
{
if(get_cvar_num("amx_logging") == 1)
{
new username[32]
new ipaddress[32]
new logline[192]
new filename[100]
get_time("player_logs/%Y-%m-%d--players.log", filename, 99)
get_user_name(id, username, 31)
get_user_ip(id, ipaddress, 31)
format(logline, 191, "%s <IP Address: %s> has connected.", username, ipaddress)
log_to_file(filename, logline)
}
return PLUGIN_HANDLED
}
The amxx: