|
发表于 2009-4-10 10:12:42
|
显示全部楼层
|阅读模式
来自 中国–上海–上海–浦东新区
本帖最后由 BliaNe 于 2009-4-10 11:13 编辑
插件源码:- #include <amxmodx>
- #include <cstrike>
- new g_inGame[33]
- public plugin_init ()
- {
- register_plugin ("User Role Logging","1.0","MaysWind");
- }
- public client_disconnect(id)
- {
- if (!g_inGame[id])
- return
- g_inGame[id] = 0
- remove_task(id)
- }
- public client_connect(id)
- {
- g_inGame[id] = 0
- }
- public client_putinserver(id)
- {
- g_inGame[id] = 1
- }
- public client_infochanged(id)
- {
- new szTeam[16], szName[32], szAuthid[32], szShortTeam[4], szRole[16]
- new iUserid = get_user_userid(id)
- get_user_team(id, szTeam, 15)
- get_user_name(id, szName, 31)
- get_user_authid(id, szAuthid, 31)
- cs_get_user_model(id, szRole, 15)
- if (equali(szTeam,"TERRORIST"))
- {
- copy(szShortTeam,2,"t")
- }
- else if (equali(szTeam,"CT"))
- {
- copy(szShortTeam,3,"ct")
- }
- else
- {
- copy(szShortTeam,2,"s")
- }
- if (!equali(szRole,"vip") && !equali(szShortTeam,"s"))
- {
- log_message("^"%s<%d><%s><%s>^" changed role to ^"#class_%s_%s^"", szName, iUserid, szAuthid, szTeam, szShortTeam, szRole)
- }
- }
复制代码 DEBUG信息:- L 04/10/2009 - 09:41:09: [CSTRIKE] Invalid player 1
- L 04/10/2009 - 09:41:09: [AMXX] Displaying debug trace (plugin "User_Role_Logging.amxx")
- L 04/10/2009 - 09:41:09: [AMXX] Run time error 10: native error (native "cs_get_user_model")
- L 04/10/2009 - 09:41:09: [AMXX] [0] User_Role_Logging.sma::client_infochanged (line 39)
复制代码 |
|