cao869 发表于 2008-3-2 12:44:59

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

#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: Invalid player 9
L 03/02/2008 - 12:13:54: Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 12:13:54: To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Rulzy 发表于 2008-3-2 17:03:14

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

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

cao869 发表于 2008-3-2 20:56:22

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

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

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

Rulzy 发表于 2008-3-2 21:03:27

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

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

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

cao869 发表于 2008-3-2 21:56:06

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

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

cao869 发表于 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: Invalid player 7
L 03/02/2008 - 22:38:16: Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 22:38:16: To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/02/2008 - 22:38:16: Invalid player 21
L 03/02/2008 - 22:38:16: Run time error 10 (plugin "admin_vip.amxx") (native "cs_reset_user_model") - debug not enabled!
L 03/02/2008 - 22:38:16: 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插件
页: [1]
查看完整版本: 为什么我的VIP服装老是出错啊,大家帮我看看