AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   the menu (https://forums.alliedmods.net/showthread.php?t=116569)

Kaaba 01-24-2010 07:48

the menu
 
I have tried to look for topics like this but i keep getting error on this:


menu_additem(menu, "Armor Menu", "10");

case '10':
{
ShowArmorMenu(client);
}

it says that invalid character constant on that case '10' how can i add 10th sub menu?

crazyeffect 01-24-2010 07:54

Re: the menu
 
Please show us your whole code.

Kaaba 01-24-2010 08:04

Re: the menu
 
ShowMainMenu(client)
{
static title[128];
formatex(title, sizeof(title) - 1, "[Skill Mod]^nMain Menu^n^nYour XP: \w%i", g_xp[client]);
new menu = menu_create(title, "MenuMain");

menu_additem(menu, "\yHelp", "*");
if( ANY_ABILITY_ENABLED )
{
menu_additem(menu, "Player Info", "1");
}
if( g_any_wep_enabled )
{
menu_additem(menu, "Weapon Menu", "2");
}
if( g_any_bul_enabled )
{
menu_additem(menu, "Bullet Menu", "3");
}
if( g_any_respawn_enabled )
{
menu_additem(menu, "Respawn Menu", "4");
}
if( g_any_nofall_enabled )
{
menu_additem(menu, "Fall Damage Menu", "5");
}

if( g_any_nade_enabled )
{
menu_additem(menu, "Grenade Menu", "6");
}
if( g_any_stealth_enabled )
{
menu_additem(menu, "Stealth Menu", "7");
}
if( g_any_dmginc_enabled )
{
menu_additem(menu, "Damage Increaser Menu", "8");
}
if( g_any_health_enabled )
{
menu_additem(menu, "Health Menu", "9");
}
if( g_any_armor_enabled )
{
menu_additem(menu, "Armor Menu", "10");
}

menu_display(client, menu);
}
public MenuMain(client, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return;
}

static _access, info[4], callback;
menu_item_getinfo(menu, item, _access, info, sizeof(info) - 1, _, _, callback);
menu_destroy(menu);

switch( info[0] )
{
case '*':
{
blablablabla
show_motd(client, motd, "Skill Mod Info");
}
case '1':
{
ShowPlayerMenu(client);
}
case '2':
{
ShowWeaponsMenu(client);
}
case '3':
{
ShowBulletsMenu(client);
}
case '4':
{
ShowRespawnMenu(client);
}
case '5':
{
ShowNoFallMenu(client);
}
case '6':
{
ShowGrenadesMenu(client);
}
case '7':
{
ShowStealthMenu(client);
}
case '8':
{
ShowDmgincMenu(client);
}
case '9':
{
ShowHealthMenu(client);
}
case '10':
{
ShowArmorMenu(client);
}
}

floatman 01-24-2010 08:11

Re: the menu
 
http://forums.alliedmods.net/showthread.php?t=46364

Kaaba 01-24-2010 08:13

Re: the menu
 
Quote:

Originally Posted by floatman (Post 1065608)

i have read that, im not very good in scripting, so can you just tell me what is the problem? :S

wrecked_ 01-24-2010 08:20

Re: the menu
 
PHP Code:

menu_additem(menu"Armor Menu""10"0); // Start on page 0

case 10// No apostrophies needed
  
{
   
ShowArmorMenu(client);
  } 


Kaaba 01-24-2010 08:30

Re: the menu
 
Quote:

Originally Posted by wrecked_ (Post 1065619)
PHP Code:

menu_additem(menu"Armor Menu""10"0); // Start on page 0
 
case 10// No apostrophies needed
  
{
   
ShowArmorMenu(client);
  } 


thank you for reply, no errors now but when i press the Armor Menu ingame, it shows player info menu, which is case 1, first menu :S

Kaaba 01-24-2010 09:10

Re: the menu
 
Quote:

Originally Posted by wrecked_ (Post 1065619)
PHP Code:

menu_additem(menu"Armor Menu""10"0); // Start on page 0
 
case 10// No apostrophies needed
  
{
   
ShowArmorMenu(client);
  } 


i fixed it by

menu_additem(menu, "Armor Menu", "0")

case '0':

Now i would like to have all the menus on same page, how can i do that?

Zombiezzz 01-24-2010 11:11

Re: the menu
 
also kaaba before you show your code, click the PHP button so we can read it :P

wrecked_ 01-24-2010 12:15

Re: the menu
 
Quote:

Originally Posted by Zombiezzz (Post 1065759)
also kaaba before you show your code, click the PHP button so we can read it :P

If you can't read that, there's something wrong.

@Kabba - Create one menu and create submenus to divert the user to your armor menus, weapons, etc.


All times are GMT -4. The time now is 07:17.

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