|
传统的管理员皮肤插件权限设置是这样的- #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/myhomes_ct/myhomes_ct.mdl")
- precache_model("models/player/myhomes_te/myhomes_te.mdl")
- precache_model("models/player/myhomes_vip_ct/myhomes_vip_ct.mdl")
- precache_model("models/player/myhomes_vip_t/myhomes_vip_t.mdl")
- precache_model("models/player/myhomes_mm_ct/myhomes_mm_ct.mdl")
- precache_model("models/player/myhomes_mm_t/myhomes_mm_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, "myhomes_te")
- }
- else
- { if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_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, "myhomes_mm_t")
- }
- else
- { if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_mm_ct")
- }
- }
- }
- else
- #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/myhomes_ct/myhomes_ct.mdl")
- precache_model("models/player/myhomes_te/myhomes_te.mdl")
- precache_model("models/player/myhomes_vip_ct/myhomes_vip_ct.mdl")
- precache_model("models/player/myhomes_vip_t/myhomes_vip_t.mdl")
- precache_model("models/player/myhomes_mm_ct/myhomes_mm_ct.mdl")
- precache_model("models/player/myhomes_mm_t/myhomes_mm_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, "myhomes_te")
- }
- else
- { if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_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, "myhomes_mm_t")
- }
- else
- { if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_mm_ct")
- }
- }
- }
- 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, "myhomes_vip_t")
- }
- else
- {
- if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_vip_ct")
- }
- }
- }
- else
- {
- cs_reset_user_model(id)
- }
- }
- }
- return PLUGIN_CONTINUE
- }
- 编译出现以下一个错误
- Welcome to the AMX Mod X 1.76-300 Compiler.
- Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
- Error: Undefined symbol "ADMIN_LEVEL_c" on line 36
- 1 Error.
- Could not locate output file D:\myhomesop.amx (compile failed).
- USERS.INI文件
- ; 用户配置文件
- ; CHM 汉化组 Rulzy 汉化
- ; 文件位置: $moddir/addons/amxmodx/configs/users.ini
- ; 每行前的 ; 表示注释该行
- ; 权限标记:
- ; a - immunity (免疫,不能被 踢/封/处死/伤害 或者其他的命令影响)
- ; b - reservation (可通过预留通道加入服务器)
- ; c - amx_kick command (拥有KICK权限)
- ; d - amx_ban and amx_unban commands (拥有ban的权限)
- ; e - amx_slay and amx_slap commands (拥有强行杀死某人的权限)
- ; f - amx_map command (拥有更换地图的权限)
- ; g - amx_cvar command (可以设置amx的设置参数,但并不是所有的都可以)
- ; h - amx_cfg command (可以加载某个AMX的CFG设置文件权限)
- ; i - amx_chat and other chat commands (可以以管理员身份发布消息)
- ; j - amx_vote and other vote commands (可以发起一个投票事件)
- ; k - access to sv_password cvar (可以更改为服务器加密码)
- ; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)(可以用rcon命令来以OP身份登陆服务器)
- ; m - custom level A (自定义管理级别,为附加的其他插件预留的权限等级)
- ; n - custom level B
- ; o - custom level C
- ; p - custom level D
- ; q - custom level E
- ; r - custom level F
- ; s - custom level G
- ; t - custom level H
- ; u - menu access (拥有打开MENU管理菜单的权限)
- ; z - user (普通用户权限)
- else
- {
- if (userTeam == CS_TEAM_CT)
- {
- cs_set_user_model(id, "myhomes_vip_ct")
- }
- }
- }
- else
- {
- cs_reset_user_model(id)
- }
- }
- }
- return PLUGIN_CONTINUE
- }
- USERS.INI文件
- ; 用户配置文件
- ; CHM 汉化组 Rulzy 汉化
- ; 文件位置: $moddir/addons/amxmodx/configs/users.ini
- ; 每行前的 ; 表示注释该行
- ; 权限标记:
- ; a - immunity (免疫,不能被 踢/封/处死/伤害 或者其他的命令影响)
- ; b - reservation (可通过预留通道加入服务器)
- ; c - amx_kick command (拥有KICK权限)
- ; d - amx_ban and amx_unban commands (拥有ban的权限)
- ; e - amx_slay and amx_slap commands (拥有强行杀死某人的权限)
- ; f - amx_map command (拥有更换地图的权限)
- ; g - amx_cvar command (可以设置amx的设置参数,但并不是所有的都可以)
- ; h - amx_cfg command (可以加载某个AMX的CFG设置文件权限)
- ; i - amx_chat and other chat commands (可以以管理员身份发布消息)
- ; j - amx_vote and other vote commands (可以发起一个投票事件)
- ; k - access to sv_password cvar (可以更改为服务器加密码)
- ; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)(可以用rcon命令来以OP身份登陆服务器)
- ; m - custom level A (自定义管理级别,为附加的其他插件预留的权限等级)
- ; n - custom level B
- ; o - custom level C
- ; p - custom level D
- ; q - custom level E
- ; r - custom level F
- ; s - custom level G
- ; t - custom level H
- ; u - menu access (拥有打开MENU管理菜单的权限)
- ; z - user (普通用户权限)
复制代码 上面的插件是用自定义的级别来区分权限.比如
{
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, "myhomes_mm_t")
}
这里使用ADMIN_LEVEL_C这个自定义的级别来区分VIP MM皮肤.的
但是在zombie_plague40里面设置管理员皮肤的源码是
- // Access Flags Required (check CMDACCESS.INI for console commands)
- const ACCESS_FLAG = ADMIN_BAN // to access the admin menu
- const ACCESS_FLAG2 = ADMIN_RCON // to turn the mod on/off
- const ACCESS_FLAG3 = ADMIN_BAN // to get admin models
- // Player Models (randomly chosen, add as many as you want)
- new const model_nemesis[][] = { "zombie_source" } // Nemesis
- new const model_survivor[][] = { "leet", "sas" } // Survivor
- new const model_human[][] = { "arctic", "guerilla", "leet", "terror", "gign", "gsg9", "sas", "urban" } // Human
- new const model_admin[][] = { "mm" } // Admin (human)
- new const model_admin_zombie[][] = { "zombie_source" } // Admin (zombie)
复制代码 这个我就看的不大懂了..
不知道如何添加VIP皮肤了...
希望有高手指点下 |
|