搜索
查看: 2319|回复: 6

为什么我的VIP服装老是出错啊,大家帮我看看

[复制链接]
发表于 2008-3-2 12:44:59 | 显示全部楼层 |阅读模式 来自 中国–广东–珠海–香洲区
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike | C.H.M")
register_event("ResetHUD", "resetModel", "b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/player/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_te/admin_te.mdl")
precache_model("models/player/dcoo_liumang_ct/dcoo_liumang_ct.mdl")
precache_model("models/player/dcoo_liumang_t/dcoo_liumang_t.mdl")
precache_model("models/player/dcoo_girl_ct2/dcoo_girl_ct2.mdl")
precache_model("models/player/dcoo_girl_t1/dcoo_girl_t1.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid)
{
if (get_user_flags(id) & ADMIN_LEVEL_A)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "admin_te")
}
else
{ if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "admin_ct")
}
}
}
else
{
if (get_user_flags(id) & ADMIN_LEVEL_C)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "dcoo_girl_t1")
}
else
{ if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "dcoo_girl_ct2")
}
}
}
else
{
if (get_user_flags(id) & ADMIN_LEVEL_B)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "dcoo_liumang_t")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "dcoo_liumang_ct")
}
}
}
else
{
cs_reset_user_model(id)
}
}
}
return PLUGIN_CONTINUE
}

这是VIP服装的代码,出错日志如下:
L 03/02/2008 - 12:13:54: Start of error session.
L 03/02/2008 - 12:13:54: Info (map "de_inferno") (logfile "error_030208.log")
L 03/02/2008 - 12:13:54: [CSTRIKE] Invalid player 9
L 03/02/2008 - 12:13:54: [AMXX] Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 12:13:54: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
发表于 2008-3-2 17:03:14 | 显示全部楼层 来自 中国–福建–漳州

回复: 为什么我的VIP服装老是出错啊,大家帮我看看

增加个判断:
public resetModel(id)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
........
}
回复

使用道具 举报

 楼主| 发表于 2008-3-2 20:56:22 | 显示全部楼层 来自 中国–广东–珠海

回复: 为什么我的VIP服装老是出错啊,大家帮我看看

Post by Rulzy
增加个判断:
public resetModel(id)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
........
}

因为我刚开始接触插件,对这些不懂,老大能说明一下这个代码加在哪里吗?
我在最后好象不可以的!
回复

使用道具 举报

发表于 2008-3-2 21:03:27 | 显示全部楼层 来自 中国–福建–漳州

回复: 为什么我的VIP服装老是出错啊,大家帮我看看

就放在我写的地方就可以了

public resetModel(id)
{
的下一行
(将public resetModel(id, level, cdi) 改成 public resetModel(id) )
回复

使用道具 举报

 楼主| 发表于 2008-3-2 21:56:06 | 显示全部楼层 来自 中国–广东–珠海–香洲区

回复: 为什么我的VIP服装老是出错啊,大家帮我看看

谢谢老大,收到,我马上去试下!
回复

使用道具 举报

 楼主| 发表于 2008-3-2 23:29:49 | 显示全部楼层 来自 中国–广东–珠海–香洲区

回复: 为什么我的VIP服装老是出错啊,大家帮我看看

还是出错啊,跟以前的错误一样的?
L 03/02/2008 - 22:38:16: Start of error session.
L 03/02/2008 - 22:38:16: Info (map "de_dust2") (logfile "error_030208.log")
L 03/02/2008 - 22:38:16: [CSTRIKE] Invalid player 7
L 03/02/2008 - 22:38:16: [AMXX] Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 22:38:16: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/02/2008 - 22:38:16: [CSTRIKE] Invalid player 21
L 03/02/2008 - 22:38:16: [AMXX] Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 22:38:16: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
回复

使用道具 举报

发表于 2009-2-13 15:29:40 | 显示全部楼层 来自 中国–福建–宁德
在插件添加文件pu里加 debug

如下:

123.amxx debug ;XX插件
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表