Raised This Month: $ Target: $400
 0% 

Menu keys?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-11-2006 , 15:20   Menu keys?
Reply With Quote #1

How can I make the keys react to the menu?
I've tried in the switch and this way. I can't make it work
NOTE this is only a test plugin for menus.
Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("test", "1.00", "Werewolf")             register_clcmd("say menu", "test")     register_clcmd("say_team menu", "test")     register_clcmd("say /menu", "test")     register_clcmd("say_team /menu", "test")             register_menucmd(register_menuid("test"),1023,"testkeys") } public test(id) {     new menu[1024]     format(menu, 1023, "Select power^n^n1. Godmode!^n2. Noclip!^n^n0. Exit")     new key = MENU_KEY_0|MENU_KEY_1     show_menu(id, key, menu)     return PLUGIN_CONTINUE } public testkeys(id, key) {     if(key == 0)     {         if(!(get_user_flags(id)&ADMIN_IMMUNITY))         {         client_print(id, print_chat, "You do not have access to that power.")         return PLUGIN_HANDLED         }             set_user_godmode(id)             return PLUGIN_CONTINUE     }     if(key == 1)     {         if(!(get_user_flags(id)&ADMIN_IMMUNITY))         {         client_print(id, print_chat, "You do not have access to that power.")         return PLUGIN_HANDLED         }                     set_user_noclip(id)             return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }
Werewolf is offline
 



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 20:21.


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