Raised This Month: $ Target: $400
 0% 

registering menus.. [ umm, solved! ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 06-13-2006 , 08:04  
Reply With Quote #2

okay, i looked how its done in amxx source and came up with this (if anyone is interested..)

Code:
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          //keypress is catched in client_command()     message_begin(MSG_ONE,gMsg_ShowMenu,{0,0,0},controller)     write_short(keys)     write_char(-1)     write_byte(0)     write_string(menu)     message_end()     return PLUGIN_CONTINUE } public client_command(id) {     if(id != controller || !hasmenu) return PLUGIN_CONTINUE     new cmd[12]     read_argv(0, cmd,11)     if(equal(cmd,"menuselect")) {         hasmenu = false         new num[2]              //no need to check if menu even has this key,         read_argv(1, num,1)     //coz menuselect wont be called if it doesnt         engclient_cmd(controlled, "menuselect",num)     }     return PLUGIN_CONTINUE }
__________________
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