- 听众
- 收听
- 积分
- 3894
- 主题
- 回帖
- 0
- 精华
注册时间2008-4-22
最后登录1970-1-1
该用户从未签到
|
发表于 2010-10-18 22:16:01
|
显示全部楼层
- // 修改对应的权限所使用的模型,举一反三 添加相应的权限模型设置自定义模型
-
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <hamsandwich>
- // 请修改成相应的权限
- #define ADMIN_OP_LEVEL ADMIN_LEVEL_F // "q"
- #define ADMIN_VIP_LEVEL ADMIN_LEVEL_G // "r"
- #define ADMIN_MM_LEVEL ADMIN_LEVEL_H // "t"
- // 请修改成你所需要的模型
- new g_Model[6][]={
- "CVTOP_T", // OP(T)
- "CVTOP_CT", // OP(CT)
- "CVTVIP_T", // VIP(T)
- "CVTVIP_CT", // VIP(CT)
- "CVTMM_T", // MM(T)
- "CVTMM_CT" // MM(CT)
- }
- public plugin_init(){
- register_plugin("Admin Model","2.3","Rulzy")
- RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
- }
- public plugin_precache(){
- new modelname[64]
- for(new i=0;i<6;i++){
- formatex(modelname, 63, "models/player/%s/%s.mdl", g_Model[i], g_Model[i])
- precache_model(modelname)
- }
- }
- public fw_PlayerSpawn(id)
- {
- if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_CONTINUE;
- new CsTeams:userTeam = cs_get_user_team(id);
- new ModelIndex = -1;
- new flags = get_user_flags(id);
- if (flags & ADMIN_OP_LEVEL){
- if (userTeam == CS_TEAM_T){
- ModelIndex = 0
- }
- else if(userTeam == CS_TEAM_CT) {
- ModelIndex = 1
- }
- }else if (flags & ADMIN_VIP_LEVEL){
- if (userTeam == CS_TEAM_T){
- ModelIndex = 2
- }
- else if(userTeam == CS_TEAM_CT){
- ModelIndex = 3
- }
- }else if (flags & ADMIN_MM_LEVEL){
- if (userTeam == CS_TEAM_T){
- ModelIndex = 4
- }
- else if(userTeam == CS_TEAM_CT){
- ModelIndex = 5
- }
- }
- if(ModelIndex==-1)
- {
- cs_reset_user_model(id);
- }else{
- cs_set_user_model(id, g_Model[ModelIndex]);
- }
- return PLUGIN_CONTINUE
- }
复制代码 |
|