HLMOD.HU Forrás Megtekintés
- www.hlmod.hu/*
*
* 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]
new mapname[64]
get_mapname( mapname, 63 )
new CurrentTime[9]
get_time("%H:%M:%S",CurrentTime,8)
get_time("addons/amxmodx/playerips.log", filename, 99)
get_user_name(id, username, 31)
get_user_ip(id, ipaddress, 31)
format(logline, 191, "%s - %s", username, ipaddress, CurrentTime, mapname)
log_to_file(filename, logline)
}
return PLUGIN_HANDLED
}