|
发表于 2008-7-24 18:37:08
|
显示全部楼层
来自 中国–福建–漳州
回复: 麻烦Rulzy帮忙....各位大大进来看看
public menu_Select_Race(id, racexp[9]){
#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[10][RACE_NAME_LENGTH], i, pos, menu_msg[512], selectrace[128]
new keys
format(selectrace, 127, "%L",id ,"MENU_SELECT_RACE")
for(i=1;i<(iCvar[FT_RACES]+1);i++){
lang_GetRaceName(i,id,race_name,RACE_NAME_LENGTH_F)
}
new IsAdmin = get_user_flags(id)&ADMIN_RESERVATION;
if(iCvar[MP_SAVEXP]){
pos += format(menu_msg[pos], 512-pos, "%L",id,"SELECT_RACE_TITLE", selectrace)
for(i=1; i<(iCvar[FT_RACES]+1);i++){
if(i==5){
new selecthero[128]
format(selecthero, 127, "%L",id ,"SELECT_HERO")
pos += format(menu_msg[pos], 512-pos, "%s", selecthero)
}
if(!IsAdmin)
pos += format(menu_msg[pos], 512-pos, "\d%d. %s\d\R%d^n", i, race_name, racexp[i-1])
else{
if(i==p_data[id][P_RACE])
pos += format(menu_msg[pos], 512-pos, "\d%d. %s\d\R%d^n", i, race_name, racexp[i-1])
else if(i==p_data[id][P_CHANGERACE])
pos += format(menu_msg[pos], 512-pos, "\r%d. %s\r\R%d^n", i, race_name, racexp[i-1])
else
pos += format(menu_msg[pos], 512-pos, "\w%d. %s\y\R%d^n", i, race_name, racexp[i-1])
keys |= (1<<(i-1))
}
}
}
else{
pos += format(menu_msg[pos], 512-pos, "%s^n^n", selectrace)
for(i=1; i<(iCvar[FT_RACES]+1);i++){
if(i==5){
new selecthero[128]
format(selecthero, 127, "%L",id ,"SELECT_HERO")
pos += format(menu_msg[pos], 512-pos, "%s", selecthero)
}
if(!IsAdmin)
pos += format(menu_msg[pos], 512-pos, "\d%d. %s^n", i, race_name)
else{
if(i==p_data[id][P_RACE])
pos += format(menu_msg[pos], 512-pos, "\d%d. %s^n", i, race_name)
else if(i==p_data[id][P_CHANGERACE])
pos += format(menu_msg[pos], 512-pos, "\r%d. %s^n", i, race_name)
else
pos += format(menu_msg[pos], 512-pos, "\w%d. %s^n", i, race_name)
keys |= (1<<(i-1))
}
}
}
keys |= (1<<(i-1))
if(iCvar[FT_RACES] == 9)
i = 0
pos += format(menu_msg[pos], 512-pos, "%L",id,"SELECT_RACE_FOOTER", i)
if(iCvar[FT_RACES] != 9){ // Add a cancel button
keys |= (1<<9)
pos += format(menu_msg[pos], 512-pos, "^n\w0. %L", id, "WORD_CANCEL")
}
show_menu(id, keys, menu_msg, -1)
return PLUGIN_HANDLED
} |
|