帮忙看下这个代码,40行……
这个是在管理员个性服装插件的基础上增加和更改了一些东西,目的是想增加一个mm的皮肤来绑定mm玩家,思路是这样:检查玩家的权限是否有“m”权限(原插件是检查是否有“c”权限),有的话指定玩家模型为OP模型。检查玩家是否有“n”权限,有的话指定玩家模型为mm模型。编译没有错误,没有警告,而且客户端也已经可以下载模型文件了,但是以有"n"权限的ID进入模型并没有改变,也就是模型并没有被更改成mm的模型。
想请教一下,这个,如何改?
帮帮忙,本人是一个实实在在的菜鸟,连基本的都不懂,非常感谢!
#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/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_te/admin_te.mdl")
precache_model("models/player/mm_ct/mm_ct.mdl")
precache_model("models/player/mm_te/mm_te.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, "admin_te")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "admin_ct")
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_te")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "mm_ct")
}
}
else {
cs_reset_user_model(id)
}
}
}
return PLUGIN_CONTINUE
}
回复: 帮忙看下这个代码,40行……
注意编程排版就不会出现这种错误。{} 错误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, "admin_te")
}
else
{ if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "admin_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, "mm_te")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mm_ct")
}
}
}
else
{
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
回复: 帮忙看下这个代码,40行……
太谢谢了我爱你……!
回复: 帮忙看下这个代码,40行……
如果编译拥有A权限 是管理员拥有B权限是VIPADMIN_LEVEL_A和ADMIN_LEVEL_B 应该改为什么???
回复: 帮忙看下这个代码,40行……
论坛里面有#define ADMIN_IMMUNITY (1<<0) /* flag "a" */
#define ADMIN_RESERVATION (1<<1) /* flag "b" */
#define ADMIN_KICK (1<<2) /* flag "c" */
#define ADMIN_BAN (1<<3) /* flag "d" */
#define ADMIN_SLAY (1<<4) /* flag "e" */
#define ADMIN_MAP (1<<5) /* flag "f" */
#define ADMIN_CVAR (1<<6) /* flag "g" */
#define ADMIN_CFG (1<<7) /* flag "h" */
#define ADMIN_CHAT (1<<8) /* flag "i" */
#define ADMIN_VOTE (1<<9) /* flag "j" */
#define ADMIN_PASSWORD (1<<10) /* flag "k" */
#define ADMIN_RCON (1<<11) /* flag "l" */
#define ADMIN_LEVEL_A (1<<12) /* flag "m" */
#define ADMIN_LEVEL_B (1<<13) /* flag "n" */
#define ADMIN_LEVEL_C (1<<14) /* flag "o" */
#define ADMIN_LEVEL_D (1<<15) /* flag "p" */
#define ADMIN_LEVEL_E (1<<16) /* flag "q" */
#define ADMIN_LEVEL_F (1<<17) /* flag "r" */
#define ADMIN_LEVEL_G (1<<18) /* flag "s" */
#define ADMIN_LEVEL_H (1<<19) /* flag "t" */
#define ADMIN_MENU (1<<20) /* flag "u" */
#define ADMIN_USER (1<<25) /* flag "z" */
回复: 帮忙看下这个代码,40行……
谢谢楼主我已经搞定现在有个问题
如果我想在这个上面 再加种模型代码该从哪里加?
看看我是否加对了!
#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/mxctadmin/mxctadmin.mdl")
precache_model("models/player/mxtadmin/mxtadmin.mdl")
precache_model("models/player/mxctvip/mxctvip.mdl")
precache_model("models/player/mxtvip/mxtvip.mdl")
precache_model("models/player/mxmmct/mxmmct.mdl")
precache_model("models/player/mxmmt/mxmmt.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "mxtadmin")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxctadmin")
}
}
}
else
{
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, "mxmmt")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxmmct")
}
}
}
else
{
if (get_user_flags(id) & ADMIN_RESERVATION)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "mxtvip")
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "mxctvip")
}
}
}
else
{
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
回复: 帮忙看下这个代码,40行……
顶啊高手解决一下!!~~
回复: 帮忙看下这个代码,40行……
会的朋友进来看看啊!~我顶上去!~~
急啊。。
谢谢!
回复: 帮忙看下这个代码,40行……
public plugin_precache() {precache_model("models/player/mxctadmin/mxctadmin.mdl")
precache_model("models/player/mxtadmin/mxtadmin.mdl")
precache_model("models/player/mxctvip/mxctvip.mdl")
precache_model("models/player/mxtvip/mxtvip.mdl")
precache_model("models/player/mxmmct/mxmmct.mdl")
precache_model("models/player/mxmmt/mxmmt.mdl")
在这里按照格式加入呀?
你说的话我不是很理解。
回复: 帮忙看下这个代码,40行……
谢谢您的关注!对啊模型位置已经加了
你仔细看一下我的 代码
kinsprite 的代码 只有2种 模型(管理和 MM)
我现在想加 3种模型 (管理 ;MM;VIP)
但是我不知道 代码从哪里加起 。。。我发的代码 是我自己加的 但是不能编译~!
请问 是哪里出错! 该如何加??
谢谢了!
页:
[1]
2