tingshow163 发表于 2009-2-2 09:38:56

关于vip皮肤设置的疑问

传统的管理员皮肤插件权限设置是这样的#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皮肤了...

希望有高手指点下

tingshow163 发表于 2009-2-2 09:40:00

貌似最上面的源码多复制了一点.. 大家千万别用那个保存成admin_model.sma去编译哦

tingshow163 发表于 2009-2-2 09:55:54

是不是可以这样写呢?

const ACCESS_FLAG3 = ADMIN_LEVEL_A

new const model_admin_mm[][] = { "mm" } // Admin (human)

jiunnwoei2629 发表于 2009-2-2 11:49:12

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).
首先我先看到你的錯誤太明顯了
ADMIN_LEVEL_c的C怎麼會是小寫
難怪他會顯示出錯誤

第二個
我建議你看完ZP的原碼
先到public fw_PlayerSpawn_Post(id)
裡面有
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG3)
的ACCESS_FLAG3這個就是設定權限的
他用成
const ACCESS_FLAG3 = ADMIN_BAN
這樣你就可以知道你該藉由什麼來設定權限在ZP裡面的吧
我例如一個
const ACCESS_FLAG4 = ADMIN_LEVEL_C
那你的ZP原碼裡面就要加上
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG4)

tingshow163 发表于 2009-2-2 12:16:59

if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG4)不知道可用不等晚上测试下

jiunnwoei2629 发表于 2009-2-2 12:43:28

我是參考ZP的ADM服裝來寫的
稍微看了一下 應該是可以的
只要沒有設定錯的話 就可以了

summerice 发表于 2009-2-11 07:08:11

这个插件会群T.如果有人能解决,就万分感谢.

hjj8 发表于 2009-2-11 23:02:25

解决一下呀

riee 发表于 2009-2-22 01:11:40

僵尸服VIP皮肤我也很想实现这个功能。。
楼主如果实现了麻烦把代码共享下啊。。。

riee 发表于 2009-2-22 16:09:23

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 ...
jiunnwoei2629 发表于 2009-2-2 11:49 http://www.dt-club.net/forum/images/common/back.gif
jiunnwoei2629 大大能详细的介绍下如何自定义僵尸VIP皮肤插件吗?
看您水平蛮高的。。
帮帮小弟吧
页: [1] 2 3
查看完整版本: 关于vip皮肤设置的疑问