AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [solved]how to make a disabled option in old style menu (https://forums.alliedmods.net/showthread.php?t=101164)

Owyn 08-21-2009 13:24

[solved]how to make a disabled option in old style menu
 
hi, i'm trying to make a menu which shows players, players with immunity should be as disabled grey option, but i can't figure out how to make that, i tried not specifing keys for immune player but that doesn't make menu item gray plus it makes wrong menu item disabled (1 should be disabled, but it disables 2nd item, 1st is still clickable) (all still in white color anyway) =\ here's the code
PHP Code:

public ShowPlayerMenu(id)
{
  new 
arrayloc 0
  
new keys = (1<<9)

  
arrayloc format(ga_MenuData,(MAX_menudata-1),"voteban menu ^n")
  for(
i=0i<8i++)
   if( 
gi_TotalPlayers>(gi_MenuPosition+i) )
   {
    if(
immunity[gi_MenuPosition+i]) //has immunity
    
{
        
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"%d. %s^n"i+1ga_PlayerName[gi_MenuPosition+i])
        
keys |= (1<<i)
    }
    else
    {    
        
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"%d. %s^n"i+1ga_PlayerName[gi_MenuPosition+i])
        
keys |= (1<<i)
    }
        
    
   }
  if( 
gi_TotalPlayers>(gi_MenuPosition+8) )
  {
    
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n9. Еще")
    
keys |= (1<<8)
  }
  
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n0. Назад/Выход")

  
show_menu(idkeysga_MenuData20"ChoosePlayer")
  return 
PLUGIN_HANDLED 



zacky 08-21-2009 13:39

Re: how to make a disabled option in old style menu
 
This is just for making the menu text gray
Write \d to make the text gray.

Owyn 08-21-2009 13:41

Re: how to make a disabled option in old style menu
 
ok, now i have to figure out how to make right items disabled ><

edit: when i use \d to make one item grey it makes all items grey ><

edit2: added \w to other options, so they are white now, and fixed other things i wanted, hope all works like it should now


All times are GMT -4. The time now is 15:16.

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