Raised This Month: $ Target: $400
 0% 

menu help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AAleaderNik
Member
Join Date: Dec 2005
Old 11-08-2006 , 22:29   menu help
Reply With Quote #1

i wanna know what i should use if i wanted to make a menu so you can buy weapons because ive looked on a few plugins and have seen different ways of doing menus
AAleaderNik is offline
sub
Senior Member
Join Date: Nov 2004
Location: Morristown, New Jersey
Old 11-08-2006 , 23:05   Re: menu help
Reply With Quote #2

Heres a couple kinds

New Way (Kinda Confusing But Its good)
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Menu System" #define VERSION "1.0" #define AUTHOR "ChrisK" #define Keysmymenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890 new mMyMenuTitle // Menu new mcbMyMenuTitle // Menu Callback public plugin_init() {     /* Menu My Menu Title */     /* Use menu_display(id, mMyMenuTitle, 0) to show the menu to an user. */     mMyMenuTitle = menu_create("My Menu Title", "mh_MyMenuTitle")     mcbMyMenuTitle = menu_makecallback("mcb_MyMenuTitle")     menu_additem(mMyMenuTitle, "1. My First Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "2. My Second Item Name ", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "3. My Third Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "4. My Fourth Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "5. My Fifth Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "6. My Sixth Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "7. My Seventh Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "8. My Eighth Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "9. My Ninth Item Name", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     menu_additem(mMyMenuTitle, "0. Quit", "ma_MyMenuTitle", ADMIN_ALL, mcbMyMenuTitle)     /* Menu End */     register_plugin(PLUGIN, VERSION, AUTHOR)     } /* Menu My Menu Title */ public mh_MyMenuTitle(id, menu, item) {     /* This event is called when someone presses a key on this menu */ } public ma_MyMenuTitle(id) {     /* This event is called when an item was selected */ } public mcb_MyMenuTitle(id, menu, item) {     /* This is the callback-event, here you can set items enabled or disabled. */     /* If you want to enable an item, use: return ITEM_ENABLED */     /* If you want to disable an item, use: return ITEM_DISABLED */ }

or the wa yI like
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Simple Menu System" #define VERSION "1.0" #define AUTHOR "ChrisK" #define Keysmymenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_menucmd(register_menuid("mymenu"), Keysmymenu, "Pressedmymenu") } public Showmymenu(id) {     show_menu(id, Keysmymenu, "My Menu2^n1. My First Item^n2. My Second Item^n3. My Third Item^n4. My Fourth Item^n5. My Fifth Item^n6. My Sixth Item^n7. My Seventh Item^n8. My Ninth Item^n9. My Ninth Item^n0. Quit^n", -1, "mymenu") // Display menu } public Pressedmymenu(id, key) {     switch (key) {         case 0: { // 1                     }         case 1: { // 2                     }         case 2: { // 3                     }         case 3: { // 4                     }         case 4: { // 5                     }         case 5: { // 6                     }         case 6: { // 7                     }         case 7: { // 8                     }         case 8: { // 9                     }         case 9: { // 0                     }     } }
sub is offline
Send a message via AIM to sub Send a message via MSN to sub
AAleaderNik
Member
Join Date: Dec 2005
Old 11-09-2006 , 00:32   Re: menu help
Reply With Quote #3

thanks very much for that code it really helps but i did this before i checked this forum again and i was wondering why it doesnt work

Code:
#include <amxmodx>
#include <amxmisc>


public plugin_init()
{
 register_plugin("amx_sounds","1.0","Nik")
 register_menucmd(register_menuid("Sounds"),1023,"actionMenu")
 register_clcmd("amx_sounds","showMenu",ADMIN_PASSWORD,"shows sound menu")
}

public actionMenu(id,key)
{
 switch(key){
 case 0:{
client_cmd(0,"spk sound/kill.wav")
 }
 }

 return PLUGIN_HANDLED
}

public showMenu(id,level,cid)
{
 if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED

 new menuBody[512]
 new len = format(menuBody,511, "\ySounds\R^n^n\w", "Sounds^n^n")
 len += format(menuBody[len],511-len,"1. kill^n^n0. exit")
 show_menu(id, 1023 ,menuBody)

 return PLUGIN_HANDLED
}
public plugin_precache() {
    precache_sound("kill.wav")
    
    return PLUGIN_CONTINUE 
 }
AAleaderNik is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-09-2006 , 00:56   Re: menu help
Reply With Quote #4

here try this
Code:
#include <amxmodx> #include <amxmisc> new keys = MENU_KEY_0 |  MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9; new menu[192] public plugin_init() {     register_plugin("amx_sounds","1.0","Nik");     register_menu("menu_show",1023,"menu_choose");     register_clcmd("amx_sounds","show_menu",ADMIN_PASSWORD,"shows sound menu"); } public menu_choose(id,key) {     switch(key)     {         case 0:client_cmd(0,"spk sound/kill.wav");     }     return PLUGIN_HANDLED; } public menu_show(id,level,cid) {     if (!cmd_access(id,level,cid,1))     {         return PLUGIN_HANDLED;      }else{                 format(menu,191,"1. kill^n^n0. exit");         show_menu(id, keys ,menu,-1,"menu_choose");             return PLUGIN_HANDLED     }     return PLUGIN_HANDLED; } public plugin_precache()  {     precache_sound("misc/kill.wav"); }
The Specialist is offline
Send a message via AIM to The Specialist
AAleaderNik
Member
Join Date: Dec 2005
Old 11-09-2006 , 02:51   Re: menu help
Reply With Quote #5

when i tryed typing in amx_sounds and it said unknown: amx_sounds its under plugins.ini and everything is good i cant see anything wrong with the code
AAleaderNik is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-09-2006 , 03:13   Re: menu help
Reply With Quote #6

oops sorry man i forgot to link the cliet command to the menu function . here it is this one should work . if you want to add more stuff to the menu just follwo my examples here.
Attached Files
File Type: sma Get Plugin or Get Source (my_menu.sma - 733 views - 864 Bytes)
The Specialist is offline
Send a message via AIM to The Specialist
AAleaderNik
Member
Join Date: Dec 2005
Old 11-09-2006 , 14:35   Re: menu help
Reply With Quote #7

it says debug not enabled
AAleaderNik is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-09-2006 , 18:52   Re: menu help
Reply With Quote #8

enable debuging by puting debug behins the name of the plugin in your plugins.ini file. it will debug it and give you th run time erors.
The Specialist is offline
Send a message via AIM to The Specialist
AAleaderNik
Member
Join Date: Dec 2005
Old 11-09-2006 , 19:40   Re: menu help
Reply With Quote #9

L 11/09/2006 - 16:530: Function "show_menu" was not found
L 11/09/2006 - 16:530: [AMXX] Displaying debug trace (plugin "amx_sound.amxx")
L 11/09/2006 - 16:530: [AMXX] Run time error 19: function not found
L 11/09/2006 - 16:530: [AMXX] [0] amx_sound.sma::plugin_init (line 11)
AAleaderNik is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-09-2006 , 19:45   Re: menu help
Reply With Quote #10

Code:
#include <amxmodx> #include <amxmisc> new keys = MENU_KEY_0 |  MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9; new menu[192] public plugin_init() {  register_plugin("amx_sounds","1.0","Nik");  register_menu("menu_show",1023,"menu_choose");  register_clcmd("amx_sounds","menu_show",ADMIN_PASSWORD,"shows sound menu"); } public menu_choose(id,key) {  switch(key)  {   case 0:client_cmd(0,"spk sound/kill.wav");  }  return PLUGIN_HANDLED; } public menu_show(id,level,cid) {  if (!cmd_access(id,level,cid,1))  {   return PLUGIN_HANDLED;  }else{     format(menu,191,"1. kill^n^n0. exit");   show_menu(id, keys ,menu,-1,"menu_show");     return PLUGIN_HANDLED  }  return PLUGIN_HANDLED; } public plugin_precache()  {  precache_sound("misc/kill.wav"); }
The Specialist is offline
Send a message via AIM to The Specialist
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 06:50.


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