I have code that displays a menu of options to vote etc...
The words and color options are white, need to change the colors of the options for red, and the color of the menu title to yellow:
PHP Code:
public ShowMenuchooseplayer(id, position) {
// Menu stuff //
if (position < 0) { return 0; }
new i, k
new MenuBody[255]
new CurrentKey = 0
new Start = position * 7
new Num
new UserName[32]
get_players(MenuPlayerschooseplayer, Num)
if (Start >= Num) { Start = position = MenuPoschooseplayer = 0; }
new Len = format(MenuBody, 255, "Vote Now Players%d/%d^n^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) )
new End = Start + 7
new Keys = (1<<9)
if (End > Num) { End = Num; }
for(i=Start;i<End;i++) {
k = MenuPlayerschooseplayer[i]
get_user_name(k, UserName, 31)
Keys |= (1<<CurrentKey++)
Len += format(MenuBody[Len], (255-Len), "%i. %s^n", CurrentKey, UserName)
}
if (End != Num) {
format(MenuBody[Len], (255-Len), "^n9. Next^n%s", position ? "0. Back" : "0. Exit")
Keys |= (1<<8)
}
else {
format(MenuBody[Len], (255-Len), "^n%s", position ? "0. Back" : "0. Exit")
}
show_menu(id, Keys, MenuBody, -1, "chooseplayer")
return 0
}
the name of the player had been yellow %s
and options "1 YES | 2 NO" red:
PHP Code:
}
voteplayer[id] = toplayer
new menu[256]
new name[32]
get_user_name(toplayer,name,31)
format(menu,255,"Are you sure you want to vote now to player:^n%s?^nHe will have a point with your vote,^nand earned bonus^nand your bonus points will be deducted^n%s won^npoints and bonus^n^n1. YES^n2. NO^n",name,name)
show_menu(id, Keysyousure, menu, 30, "yousure") // Display menu
return PLUGIN_CONTINUE
}
PHP Code:
public voteplayer(id) {
get_user_authid(id,voteplayerids[0],31)
get_user_authid(votenowplayer[id],voteplayerids[1],31)
new menu[256]
new name1[32],name2[32]
get_user_name(id,name1,31)
get_user_name(votenowplayer[id],name2,31)
format(menu,255,"%s started a vote bonus player^nWant to donate bonus for %s?^nReason:^n^n%s^n^n1. Yes ^n2. No",name1,name2,voteplayerreason)
show_menu(0, Keysallvote, menu, 30, "allvote") // Display menu
voteendid = id
set_task(30.0,"voteend",id)
set_task(180.0,"allowvote")
canvote = true
client_print(0,print_chat,"%s started a vote bonus for %s.",name1,name2)
client_print(0,print_chat,"REASON: %s",voteplayerreason)
votenowplayer[id] = 0
suspendvoteplayer(voteplayerids[0],600,0)
}
I have read the topic new menu styles, but I can not do it in code.
If anyone knows thanks.