谢谢楼主 我已经搞定
现在有个问题
如果我想在这个上面 再加种模型 代码该从哪里加?
看看我是否加对了!
[PHP]#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/mxctadmin/mxctadmin.mdl")
precache_model("models/player/mxtadmin/mxtadmin.mdl")
precache_model("models/player/mxctvip/mxctvip.mdl")
precache_model("models/player/mxtvip/mxtvip.mdl")
precache_model("models/player/mxmmct/mxmmct.mdl")
precache_model("models/player/mxmmt/mxmmt.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "mxtadmin")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxctadmin")
}
}
}
else
{
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, "mxmmt")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxmmct")
}
}
}
else
{
if (get_user_flags(id) & ADMIN_RESERVATION)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "mxtvip")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxctvip")
}
}
}
else
{
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
[/PHP] |