搜索
查看: 4068|回复: 14

关于皮肤插件的一点问题

[复制链接]
发表于 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]
 楼主| 发表于 2008-10-12 15:56:39 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

大家帮我看看 哪里出了问题
回复

使用道具 举报

发表于 2008-10-12 22:01:33 | 显示全部楼层 来自 中国–台湾

回复: 关于皮肤插件的一点问题

我以我的寫法給你
有一些反覆的太多了
你可以簡化

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2008-10-13 09:26:43 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

问个很弱的问题
ADMIN_USER               对应的是 Z权限标记吧
ADMIN_LEVEL_A         m - custom level A
ADMIN_LEVEL_B         n - custom level B
ADMIN_LEVEL_C         o - custom level C
ADMIN_LEVEL_D         p - custom level D
ADMIN_LEVEL_E         q - custom level E

是这样吗?
回复

使用道具 举报

 楼主| 发表于 2008-10-13 09:35:25 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

[PHP]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)
}
return
}

像这样如果不加return他就继续执行:) :) [/PHP]
引用了赛盟的 Simen.newbie
他是这样说的
回复

使用道具 举报

发表于 2008-10-13 10:32:21 | 显示全部楼层 来自 中国–广西–百色–那坡县

回复: 关于皮肤插件的一点问题

Post by KzFun.小鱼
[PHP]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)
}
return
}

像这样如果不加return他就继续执行:) :) [/PHP]
引用了赛盟的 Simen.newbie
他是这样说的
实话说用这么多IF..........此插件会出现群踢的...........
回复

使用道具 举报

 楼主| 发表于 2008-10-13 16:17:51 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

问个很弱的问题
ADMIN_USER 对应的是 Z权限标记吧
ADMIN_LEVEL_A m - custom level A
ADMIN_LEVEL_B n - custom level B
ADMIN_LEVEL_C o - custom level C
ADMIN_LEVEL_D p - custom level D
ADMIN_LEVEL_E q - custom level E

是这样吗?
回复

使用道具 举报

发表于 2008-10-13 16:44:05 | 显示全部楼层 来自 中国–广西–百色–凌云县

回复: 关于皮肤插件的一点问题

Post by KzFun.小鱼
问个很弱的问题
ADMIN_USER 对应的是 Z权限标记吧
ADMIN_LEVEL_A m - custom level A
ADMIN_LEVEL_B n - custom level B
ADMIN_LEVEL_C o - custom level C
ADMIN_LEVEL_D p - custom level D
ADMIN_LEVEL_E q - custom level E

是这样吗?
你想给这些实现,在USER.INI文件里如B权限的人"BNU"才能...或"COU"....等..
回复

使用道具 举报

 楼主| 发表于 2008-10-14 11:01:26 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

我试过了
没有群踢的现象
但是开局的时候 皮肤一闪 就换回来了
问下 是什么原因
回复

使用道具 举报

 楼主| 发表于 2008-10-14 11:02:50 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 关于皮肤插件的一点问题

Post by 心静如水
你想给这些实现,在USER.INI文件里如B权限的人"BNU"才能...或"COU"....等..

; 用户配置文件
; 文件位置: $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  (普通用户权限)
; 帐号类型:
; a - 进入服务器时若密码不对则断开连接
; b - 战队标签
; c - 这是个 steamid/wonid
; d - 这是个IP地址
; e - 不检查密码,只需要id或者ip或者steamid
; 密码:
; 在自己的autoexec.cfg里加入: setinfo _pw "<管理员密码>"
; 请将此处的 _pw 改为 amx_password_field 设定的密码
; 管理员帐号格式:
; <名字|ip|steamid> <管理员密码> <权限等级> <帐号类型>
; 例子:
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"

想问下 这个是怎么配置的
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表