View Single Post
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 10-11-2018 , 15:26   Re: Plugin Request [Admin Command Logs]
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_cmdLine1[512], g_cmdLine2[512], g_cmdLine3[512], g_cmdLine4[512]

public 
plugin_init()
{
    
register_plugin("Admin Commands Logger""1.0""TheWhitesmith"// Edited by D4rkSiD3Rs
}

public 
client_command(id)
{
    if(!(
get_user_flags(id) & ADMIN_KICK) && !(get_user_flags(id) & ADMIN_BAN))
        return 
PLUGIN_CONTINUE

    
new name[32]
    new 
authid[32]
    new 
logfile[50];
    new 
configsdir[20];

    new 
text[charsmax(name)+(4*charsmax(g_cmdLine1))]
    
get_configsdir(configsdircharsmax(configsdir));
    
formatex(logfilecharsmax(logfile), "%s/admin_commands_log.txt"configsdir);
    
get_user_name(idnamecharsmax(name))
    
get_user_authid(idauthidcharsmax(authid))

    
read_argv(0g_cmdLine1511)
    
read_argv(1g_cmdLine2511)
    
read_argv(2g_cmdLine3511)
    
read_argv(3g_cmdLine4511)
    
    static 
datestr[11]
    
get_time("%Y-%m-%d"datestr10)
    new 
timestr[9]
    
get_time("%H:%M:%S"timestr8)

    
formatex(textcharsmax(text), "L %s - %s: Name: %s | SteamID: %s | Command: %s %s %s %s"datestrtimestrnameauthidg_cmdLine1g_cmdLine2g_cmdLine3g_cmdLine4);
    
write_file(logfiletext)
    
    return 
PLUGIN_CONTINUE

__________________


D4rkSiD3Rs is offline