I got plugin called trace.ammx which trace the IP,NICK and Steam ID of users.
It save the log in configs folder and only in one .txt file.
But I want to save the logs in this folder
"addons/amxmodx/logs/IP logs/"
and logs should create daily new file with the date...
As this chat_logger.amxx do the same create new file daily under the name of date.
Source code of chat_logger.amxx
https://forums.alliedmods.net/attach...7&d=1164988404
The code of trace.amxx is below.
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Log IP"
#define VERSION "1.0"
#define AUTHOR "Anakin"
new toggle;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
toggle = register_cvar("ip_log","1");
}
public client_connect(id)
{
if(get_pcvar_num(toggle) != 1) return;
IP_Log(id);
}
IP_Log(id)
{
new szFile[128];
get_configsdir(szFile,127);
formatex(szFile,127,"%s/ip_log.txt",szFile);
if(!file_exists(szFile))
{
write_file(szFile,"Ips Connected",-1);
write_file(szFile," ",-1)
}
new name[32],ip[32],sztime[54],szLog[256], szAuthID[32];
get_user_name(id,name,31);
get_user_ip(id,ip,31);
get_user_authid(id, szAuthID, charsmax(szAuthID));
get_time("%m.%d.%Y -- %H:%M:%S",sztime,53);
formatex(szLog,255,"Player: %s IP: %s SteamID: %s Date: %s",name,ip, szAuthID, sztime);
write_file(szFile,szLog,-1);
}