Raised This Month: $ Target: $400
 0% 

OnLogAction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 01-12-2009 , 23:44   OnLogAction
Reply With Quote #1

In SourceMod, OnLogAction is an event that takes place, if a plugin fires something to the logs.

Is there an equivalent in AMXx?
Is there something I can use to log only those commands coming from plugins, and not everything.

I am using this right now:

Code:
public plugin_log()
{
    new logdata0[128], logdata1[64], logdata2[64], logdata3[64]
    new adminname[32], client
    new message[1024]
    
    read_logdata(message, 1023)

    //Get the args from the log data
    read_logargv(0,logdata0,127)
    read_logargv(1,logdata1,63)
    read_logargv(2,logdata2,63)
    read_logargv(3,logdata3,63)
    
    parse_loguser(logdata0, adminname, 31)
    client = get_user_index(adminname)
    
    if (client > 0 && (get_user_flags(client) & ADMIN_BAN))
    {
        new authid[31]
        get_user_authid(client, authid, 31)
        replace(adminname, 31, "'", "")
            
        new data[3]
        format(data, 2, "%d", client)

        format(g_Cache, sizeof(g_Cache), "INSERT INTO commands (steam_id, name, time, game, ip, command, players) VALUES('%s', '%s', UNIX_TIMESTAMP(), '%s', '%s', '%s', %i);", authid, adminname, GameName, serverip, message, get_playersnum())        
        server_print("Query: %s", g_Cache)
            
        SQL_ThreadQuery(SqlConnection, "QueryHandle", g_Cache, data, 3)
    }
}
but it logs everything, including kills and joining the server, etc...
I just would like it to log stuff like ban, slay or admin commands....
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
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 01:42.


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