Raised This Month: $ Target: $400
 0% 

the menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kaaba
Member
Join Date: Nov 2009
Old 01-24-2010 , 07:48   the menu
Reply With Quote #1

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?
Kaaba is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 01-24-2010 , 07:54   Re: the menu
Reply With Quote #2

Please show us your whole code.
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Kaaba
Member
Join Date: Nov 2009
Old 01-24-2010 , 08:04   Re: the menu
Reply With Quote #3

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);
}
}
Kaaba is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-24-2010 , 08:11   Re: the menu
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=46364
__________________

floatman is offline
Kaaba
Member
Join Date: Nov 2009
Old 01-24-2010 , 08:13   Re: the menu
Reply With Quote #5

Quote:
Originally Posted by floatman View Post
i have read that, im not very good in scripting, so can you just tell me what is the problem? :S
Kaaba is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-24-2010 , 08:20   Re: the menu
Reply With Quote #6

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

case 10// No apostrophies needed
  
{
   
ShowArmorMenu(client);
  } 
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Kaaba
Member
Join Date: Nov 2009
Old 01-24-2010 , 08:30   Re: the menu
Reply With Quote #7

Quote:
Originally Posted by wrecked_ View Post
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 is offline
Kaaba
Member
Join Date: Nov 2009
Old 01-24-2010 , 09:10   Re: the menu
Reply With Quote #8

Quote:
Originally Posted by wrecked_ View Post
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?
Kaaba is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 01-24-2010 , 11:11   Re: the menu
Reply With Quote #9

also kaaba before you show your code, click the PHP button so we can read it
__________________
Zombiezzz is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-24-2010 , 12:15   Re: the menu
Reply With Quote #10

Quote:
Originally Posted by Zombiezzz View Post
also kaaba before you show your code, click the PHP button so we can read it
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.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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