|
本帖最后由 ningyusky 于 2015-3-12 20:44 编辑
// 添加到amxx.cfg里面
mt_sql_host "localhost"
mt_sql_user "admin"
mt_sql_pass "admin"
mt_sql_db "admin"
mt_log_srvname "[CSPub 1#]"
// 修改MTlog.php里面的参数放在WEB目录
[mw_shl_code=pawn,true]#include <amxmodx>
#include <amxmisc>
#define MAX_MSG_LEN 2048
new g_szBuffer[MAX_MSG_LEN]
new g_szMsg[MAX_MSG_LEN]
new iLen
native mt_log_mysql(const string[]);
public plugin_init()
{
register_plugin("Test Log", "1.0, "Koma")
}
public client_connect(id)
{
new IP[32],NAME[32]
get_user_ip(id,IP,31)
get_user_name(player, name2, 31)
format(g_szMsg,MAX_MSG_LEN - 1,"%s <%s> 正在登录游戏...", NAME,IP)
if(!is_user_bot(player))
mt_log_mysql(g_szMsg)
}[/mw_shl_code]
测试效果:http://www.cs-pub.com/adminX.php
|
|