Raised This Month: $ Target: $400
 0% 

logfile (Help)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Id0x.
Junior Member
Join Date: Dec 2020
Old 01-15-2021 , 11:24   logfile (Help)
Reply With Quote #1

Why not give complete information ( SteamID: XX | IP: XX )

HTML Code:
L 16:15:31: ** Name: <Warrior>
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>

new const szLogDir[] = "addons/amxmodx/logs/ConnectLogger"

public plugin_init()
{
    if(!
dir_exists(szLogDir)) mkdir(szLogDir)
}
public 
client_putinserver(id)
{
    if(!
is_user_bot(id) && is_user_connected(id))
        
set_task(2.0,"Save",id)
}
public 
Save(id)
{
    new 
name[32]
    
get_user_name(idnamecharsmax(name))

    new 
authid[32]
    
get_user_authid(idauthid31)

    new 
ip[32]
    
get_user_ip(idip31)
    
    new 
logfile[50];
    new 
text[charsmax(name)]
    
    static 
datestr[11]
    
get_time("%Y-%m-%d"datestr10)
    new 
timestr[9]
    
get_time("%H:%M:%S"timestr8)

    
formatex(logfilecharsmax(logfile), "%s/%s"szLogDirdatestr)
    
formatex(textcharsmax(text), "L %s: ** Name: %s | SteamID: %s | IP: %s **"timestrnameauthidip)
    
write_file(logfiletext)

Id0x. is offline
 


Thread Tools
Display Modes

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:09.


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