I want to make a plugin for log all players keybinds, when the player connected.
But I found some question on this plugin.Please help me to solve the problem.
And then,I want to know how to get player all "bind" cvars on the plugin?Thank All Very Much!!
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "KeyBinds Logs"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "ryo89589"
new name[32], keybind[32]
new const LogFile[] = "keybind.log"
new g_LogFilePath[96]
public plugin_init()
{
register_plugin (PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
}
public plugin_precache()
{
static logDir[64]
get_localinfo("amxx_logs", logDir, charsmax(logDir))
if (!dir_exists(logDir)) mkdir(logDir)
format(g_LogFilePath, charsmax(g_LogFilePath), "%s/%s", logDir, LogFile)
}
public client_infochanged(id)
{
if (is_user_connected(id) && !is_user_bot(id))
{
get_user_name(id, name, 31)
get_user_info(id, "bind", keybind, 31)
log_to_file(g_LogFilePath,"[Bind Key Logs] ^"%s^" All Key Bind are %s ^n", name, keybind)
}
}