|
发表于 2008-10-12 15:45:23
|
显示全部楼层
|阅读模式
来自 中国–湖北–黄冈
修改的是
amx_adminmodel
这个插件
大家帮忙看看哪里有问题
[PHP]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("admin", "1.0", "admin")
register_event("ResetHUD", "resetModel", "b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/player/OP/OP.mdl")
precache_model("models/player/MM/MM.mdl")
precache_model("models/player/pifu1/pifu1.mdl")
precache_model("models/player/pifu2/pifu2.mdl")
precache_model("models/player/pifu3/pifu3.mdl")
precache_model("models/player/CT/CT.mdl")
precache_model("models/player/T/T.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, "OP")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "OP")
}
else {
cs_reset_user_model(id)
}
}
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, "MM")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "MM")
}
else {
cs_reset_user_model(id)
}
}
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, "pifu1")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "pifu1")
}
else {
cs_reset_user_model(id)
}
}
if (get_user_flags(id) & ADMIN_LEVEL_D) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "pifu2")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "pifu2")
}
else {
cs_reset_user_model(id)
}
}
if (get_user_flags(id) & ADMIN_LEVEL_E) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "pifu3")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "pifu3")
}
else {
cs_reset_user_model(id)
}
}
if (get_user_flags(id) & ADMIN_USER) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "T")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "CT")
}
else {
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
[/PHP] |
|