Raised This Month: $51 Target: $400
 12% 

Plz help I want to change destinatoin folder for different plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
junead101
Junior Member
Join Date: Nov 2012
Old 11-12-2012 , 03:27   Plz help I want to change destinatoin folder for different plugin.
Reply With Quote #1

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);
}
junead101 is offline
Send a message via Skype™ to junead101
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode