|
楼主 |
发表于 2007-4-12 02:40:59
|
显示全部楼层
来自 中国–广东–珠海
回复: 普通玩家服饰插件
我没有试过应该是这样吧。。
///////////////////////////////////////////////////
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("amx_m", "1.0", "ai25")
register_clcmd("amx_m_mm","reset_m_mm", ADMIN_ALL, "- MM服饰");
register_clcmd("amx_m_op","reset_m_op_task", ADMIN_ALL, "- OP服饰");
register_clcmd("amx_m_cs","reset_m_cs", ADMIN_ALL, "- 游戏默认服饰");
register_event("ResetHUD", "reset_m_op", "b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/player/CVTMMT/CVTMMT.mdl")
precache_model("models/player/CVTMMCT/CVTMMCT.mdl")
precache_model("models/player/CVTOPT/CVTOPT.mdl")
precache_model("models/player/CVTOPCT/CVTOPCT.mdl")
precache_model("models/player/gign/gign.mdl")
precache_model("models/player/leet/leet.mdl")
return PLUGIN_CONTINUE
}
public reset_m_mm(id, level, cid) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "CVTMMT")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "CVTMMCT")
}
else {
cs_reset_user_model(id)
}
}
public reset_m_op_task(id) {
set_task(1.5, "reset_m_op" , id); //延时1.5秒执行函数reset_m_op
}
public reset_m_op(id, level, cid) {
if (get_user_flags(id) & ADMIN_KICK) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "CVTOPT")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "CVTOPCT")
}
else {
cs_reset_user_model(id)
}
}
}
public reset_m_cs(id, level, cid) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "leet")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "gign")
}
else {
cs_reset_user_model(id)
}
return PLUGIN_CONTINUE
} |
|