Raised This Month: $ Target: $400
 0% 

Why this menu not working...?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 05-29-2006 , 14:47   Why this menu not working...?
Reply With Quote #1

Code:
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2     register_menucmd(register_menuid("Silver Weapons Mod"),keys,"giveWeapon")
that is plugin init

Code:
//*****{SHOWS MENU}***** public showWeaponMenu(id)   {       new menu[192]       new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2           format(menu, 191, "Silver Weapons Mod^n^n1. Silver AK47^n2. Silver M4A1^n3. Silver AWP^n")       show_menu(id, keys, menu)       return PLUGIN_HANDLED   } //*****{GETS BUTTON U CHOOSE ON MENU}***** public giveWeapon(id, key)   {       if (key == 0)       {           funcbuyak(id)     }     else if (key == 1)       {           funcbuym4(id)     }     else if (key == 2)     {           funcbuyawp(id)     } }
and that shows the menu and gets key you press but for some reason when you choose the third option is does not execute the third, why lol?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-29-2006 , 14:49  
Reply With Quote #2

show_menu(id,keys,menu,"Silver Weapons Mod")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Rolnaaba
Veteran Member
Join Date: May 2006
Old 05-29-2006 , 14:54  
Reply With Quote #3

but how wil that fix the problem with the third func? if I jsut add "Silver Weapons Mod" to that show_menu code snipette it won't change much will it?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-29-2006 , 15:12  
Reply With Quote #4

Switch to cases:
Code:
public giveWeapon(id, key)   {      switch(key)    {       case 0:       {          funcbuyak(id) // Don't know what you are trying here, but fix it       }             case 1:       {          funcbuym4(id)       }       case 2:       {          funcbuyawp(id)       } }
Peli is offline
Send a message via MSN to Peli
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-29-2006 , 15:12  
Reply With Quote #5

That will solve it. Peli's comment will not add any functionality but it slightly optimizes the script.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Rolnaaba
Veteran Member
Join Date: May 2006
Old 05-29-2006 , 15:49  
Reply With Quote #6

ahh that fixed it ty very much
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Reply



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 16:24.


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