CS菜鸟鸟 发表于 2008-7-23 08:47:44

麻烦Rulzy帮忙....各位大大进来看看

这段代码是魔兽进服选种族的时候菜单。请问怎么修改为
进入服务器拥有B权限的才能自由选择种族,如果没权限的普通玩家就只能按9键自动选择
谢谢
public menu_Select_Race(id, racexp){
#if ADVANCED_DEBUG
writeDebugInfo("menu_Select_Race",0)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if(g_mapDisabled){
client_print(id,print_chat,"%s %L", g_MODclient, id, "MAP_DISABLED")
client_print(id,print_chat,"%s %L", g_MODclient, id, "MAP_DISABLED_DUE")
}
new race_name, i, pos, menu_msg, selectrace
new keys
format(selectrace, 127, "%L",id ,"MENU_SELECT_RACE")
for(i=1;i<(iCvar+1);i++){
lang_GetRaceName(i,id,race_name,RACE_NAME_LENGTH_F)
}
if(iCvar){
pos += format(menu_msg, 512-pos, "%L",id,"SELECT_RACE_TITLE", selectrace)
for(i=1; i<(iCvar+1);i++){
if(i==5){
new selecthero
format(selecthero, 127, "%L",id ,"SELECT_HERO")
pos += format(menu_msg, 512-pos, "%s", selecthero)
}
if(i==p_data)
pos += format(menu_msg, 512-pos, "\d%d. %s\d\R%d^n", i, race_name, racexp)
else if(i==p_data)
pos += format(menu_msg, 512-pos, "\r%d. %s\r\R%d^n", i, race_name, racexp)
else
pos += format(menu_msg, 512-pos, "\w%d. %s\y\R%d^n", i, race_name, racexp)
keys |= (1<<(i-1))
}
}
else{
pos += format(menu_msg, 512-pos, "%s^n^n", selectrace)
for(i=1; i<(iCvar+1);i++){
if(i==5){
new selecthero
format(selecthero, 127, "%L",id ,"SELECT_HERO")
pos += format(menu_msg, 512-pos, "%s", selecthero)
}
if(i==p_data)
pos += format(menu_msg, 512-pos, "\d%d. %s^n", i, race_name)
else if(i==p_data)
pos += format(menu_msg, 512-pos, "\r%d. %s^n", i, race_name)
else
pos += format(menu_msg, 512-pos, "\w%d. %s^n", i, race_name)
keys |= (1<<(i-1))
}
}
keys |= (1<<(i-1))

if(iCvar == 9)
i = 0
pos += format(menu_msg, 512-pos, "%L",id,"SELECT_RACE_FOOTER", i)
if(iCvar != 9){ // Add a cancel button
keys |= (1<<9)
pos += format(menu_msg, 512-pos, "^n\w0. %L", id, "WORD_CANCEL")

}

show_menu(id, keys, menu_msg, -1)
return PLUGIN_HANDLED
}

Rulzy 发表于 2008-7-24 18:37:08

回复: 麻烦Rulzy帮忙....各位大大进来看看

public menu_Select_Race(id, racexp){
#if ADVANCED_DEBUG
writeDebugInfo("menu_Select_Race",0)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if(g_mapDisabled){
client_print(id,print_chat,"%s %L", g_MODclient, id, "MAP_DISABLED")
client_print(id,print_chat,"%s %L", g_MODclient, id, "MAP_DISABLED_DUE")
}
new race_name, i, pos, menu_msg, selectrace
new keys
format(selectrace, 127, "%L",id ,"MENU_SELECT_RACE")
for(i=1;i<(iCvar+1);i++){
lang_GetRaceName(i,id,race_name,RACE_NAME_LENGTH_F)
}
new IsAdmin = get_user_flags(id)&ADMIN_RESERVATION;
if(iCvar){
pos += format(menu_msg, 512-pos, "%L",id,"SELECT_RACE_TITLE", selectrace)
for(i=1; i<(iCvar+1);i++){
   if(i==5){
    new selecthero
    format(selecthero, 127, "%L",id ,"SELECT_HERO")
    pos += format(menu_msg, 512-pos, "%s", selecthero)
   }
   if(!IsAdmin)
    pos += format(menu_msg, 512-pos, "\d%d. %s\d\R%d^n", i, race_name, racexp)
   else{
    if(i==p_data)
   pos += format(menu_msg, 512-pos, "\d%d. %s\d\R%d^n", i, race_name, racexp)
    else if(i==p_data)
   pos += format(menu_msg, 512-pos, "\r%d. %s\r\R%d^n", i, race_name, racexp)
    else
   pos += format(menu_msg, 512-pos, "\w%d. %s\y\R%d^n", i, race_name, racexp)
    keys |= (1<<(i-1))
   }
}
}
else{
pos += format(menu_msg, 512-pos, "%s^n^n", selectrace)
for(i=1; i<(iCvar+1);i++){
   if(i==5){
    new selecthero
    format(selecthero, 127, "%L",id ,"SELECT_HERO")
    pos += format(menu_msg, 512-pos, "%s", selecthero)
   }
   if(!IsAdmin)
    pos += format(menu_msg, 512-pos, "\d%d. %s^n", i, race_name)
   else{
    if(i==p_data)
   pos += format(menu_msg, 512-pos, "\d%d. %s^n", i, race_name)
    else if(i==p_data)
   pos += format(menu_msg, 512-pos, "\r%d. %s^n", i, race_name)
    else
   pos += format(menu_msg, 512-pos, "\w%d. %s^n", i, race_name)
    keys |= (1<<(i-1))
   }
}
}
keys |= (1<<(i-1))

if(iCvar == 9)
i = 0
pos += format(menu_msg, 512-pos, "%L",id,"SELECT_RACE_FOOTER", i)
if(iCvar != 9){ // Add a cancel button
keys |= (1<<9)
pos += format(menu_msg, 512-pos, "^n\w0. %L", id, "WORD_CANCEL")

}

show_menu(id, keys, menu_msg, -1)
return PLUGIN_HANDLED
}

CS菜鸟鸟 发表于 2008-7-24 20:13:29

回复: 麻烦Rulzy帮忙....各位大大进来看看

实在是感谢啊。。。。。。。。等了这么久大大终于出来解救我门这些菜鸟了
感动ing......................

Osker Lee 发表于 2008-7-25 18:58:58

回复: 麻烦Rulzy帮忙....各位大大进来看看

仅仅是进入服务器时普通玩家随机选取种族,那么进入服务器后普通玩家是不是可以再通过“changerace”命令来更换种族呢?还是玩家输入“changerace”后,只能按数字9键来选择,其他数字1- 8键都不起作用了?

野猪 发表于 2008-8-8 13:11:19

回复: 麻烦Rulzy帮忙....各位大大进来看看

插件好奇妙,郁闷是菜鸟,尽心学半招,可惜底子薄。

野猪 发表于 2008-8-8 13:15:31

回复: 麻烦Rulzy帮忙....各位大大进来看看

衷心感谢点通的斑竹们的无私热心的帮助我们这些有心学而无力学好的菜鸟。正因为有了你们才使点通更加精彩。
页: [1]
查看完整版本: 麻烦Rulzy帮忙....各位大大进来看看