AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help this code in menu (https://forums.alliedmods.net/showthread.php?t=146949)

BackStats 01-03-2011 14:16

help this code in menu
 
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(idposition) {
    
// Menu stuff //
    
if (position 0) { return 0; }
    
    new 
ik
    
new MenuBody[255]
    new 
CurrentKey 0
    
new Start position 7
    
new Num
    
new UserName[32]
    
    
get_players(MenuPlayerschooseplayerNum)
    if (
Start >= Num) { Start position MenuPoschooseplayer 0; }
    new 
Len format(MenuBody255"Vote Now Players%d/%d^n^n"position+1, (Num + ((Num 7) ? )) )
    new 
End Start 7
    
new Keys = (1<<9)
    if (
End Num) { End Num; }
    
    for(
i=Start;i<End;i++) {
        
MenuPlayerschooseplayer[i]
        
get_user_name(kUserName31)
        
Keys |= (1<<CurrentKey++)
        
Len += format(MenuBody[Len], (255-Len), "%i. %s^n"CurrentKeyUserName)
    }
    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(idKeysMenuBody, -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(idKeysyousuremenu30"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(0Keysallvotemenu30"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.

fysiks 01-03-2011 14:19

Re: help this code in menu
 
\r starts red text
\w starts white text
\d starts grey text
\y starts yellow text


All times are GMT -4. The time now is 02:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.