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....
__________________