Raised This Month: $ Target: $400
 0% 

Write admin activity in log


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 05-25-2010 , 03:42   Re: Write admin activity in log
Reply With Quote #3

Not sure exactly you want for xx.xx.xx - xx.xx.xx, is that the start and end time?
Try this...let me know if it works, untested.

Code:
#include <amxmodx> #define PLUGIN "Admin T Logger" #define VERSION "1.0" #define AUTHOR "Dimanok" new g_szTimeIN[32][9]; new g_szTimeOut[32][9]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR); } public client_disconnect(id) {       log_event(id);     //Reset the time in & out.     g_szTimeOut[id][0] = 0;     g_szTimeIN[id][0] = 0;     return PLUGIN_HANDLED   } public client_putinserver(id) {     //(Get the current time)     get_time("%H:%M:%S",g_szTimeIN[id],8);     return PLUGIN_HANDLED } public log_event(id) {     //(Create all the new vars)     new szName[32], iFlags, szSteamID[32], szIP[32];         //(Get the users IP)     get_user_ip(id,szIP,sizeof(szIP));         //(Get the users name)     get_user_name(id, szName, charsmax(szName));         //(Get the users steamid)     get_user_authid(id,szSteamID,sizeof(szSteamID));         //(Get the users flags)     iFlags = get_user_flags(id);     //(IF iFlags contain ADMIN_LEVEL_H?)     if( (iFlags & ADMIN_LEVEL_H) )     {         get_time("%H:%M:%S",g_szTimeOut[id],8);                 new szText[128];         //(Format the String) "[Time] [Name] [SteamID] [IP Address]"         format(szText,sizeof(szText),"(%s)-(%s) ---- Name:[%s] SteamID:[%s] IP:[%s]",g_szTimeIN[id],g_szTimeOut[id],szName,szSteamID,szIP);                 //Write it to the log         log_to_file ("admin_activity.log",szText);     }     return PLUGIN_HANDLED; }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
 



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 05:23.


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