Raised This Month: $ Target: $400
 0% 

registering menus.. [ umm, solved! ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 06-12-2006 , 12:24   registering menus.. [ umm, solved! ]
Reply With Quote #1

im working on a plugin which allows admins to control.. other players
the code below works, but i was just wondering if its ok to register every menu like it does right now,
or is there another way of catching the keypress?


Code:
register_event("ShowMenu","event_showmenu", "b") ... public event_showmenu(id) {     if(id != controlled)         return PLUGIN_CONTINUE     new menu[32], keys = read_data(1)     read_data(4, menu,31)     new name[32]     get_user_name(id, name,31)     client_print(controller,print_chat, "[%s] A ShowMenu was called on %s: %s",plugin,name,menu)     hasmenu = true     new menuid = register_menuid(menu,1)     register_menucmd(menuid,keys,"action_menu")     show_menu(controller,keys,menu)     return PLUGIN_CONTINUE } public action_menu(id,key) {     if(id != controller || !hasmenu)         return PLUGIN_CONTINUE     hasmenu = false     new num[2]     num_to_str(key+1, num,1)     engclient_cmd(controlled, "menuselect",num)     return PLUGIN_HANDLED }

wont this register the same menus over and over again as they pop up on the target's screen?

EDIT: oh, i forgot to explain what to code does exactly
it just replicates the menu displayed to the controlled player to the one controlling him who can then decide what the player should "select"
__________________
plop
p3tsin 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 08:04.


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