Raised This Month: $ Target: $400
 0% 

Menu + Undermenus not working!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Timoses
Member
Join Date: Mar 2006
Location: Germany, NRW
Old 03-28-2006 , 14:35  
Reply With Quote #5

Ok this is very,very and so very weird.
I just removed the undermenus and did it the way I did it before.
And again the code request pops up if I choose an option.
So, wt? What did I do wrong?
Code:
#include <amxmodx> #include <amxmisc> #include <dbi> #include <tsx> #include <engine> #include <engine_stocks> #include <fun> #include <tsxaddon> new bar_tv[3] = { -122, -871, 32 } new bar_rightpass[5] = {5,6,4,3,7} new bar_guesscode[33][5] new Float:porigin[3] = { -306.0, -896.0, 0.0 } new playing public plugin_precache() {     precache_sound("Pimplordz/Music/smellslike.wav")     precache_sound("Pimplordz/Sound/Bass001.wav") } public plugin_init() {     register_plugin("BarTV","0.2","Timoses & Rixorster")         register_clcmd("say /login","tv_bar_guess")         register_menucmd(register_menuid("Bar TV"), 1023,"action_bar_guess")     register_menucmd(register_menuid("Bar TV Menu"),1023,"action_bar_menu") } public tv_bar_guess(id) {     new origin[3]     get_user_origin(id,origin)     if(get_distance(origin,bar_tv) <= 25.0)     {         new body[256]         new key = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)         new len = format(body,sizeof(body),"Bar TV^n")         len += format(body[len],sizeof(body)-len,"---------------------------------------^n")         len += format(body[len],sizeof(body)-len,"              .%i.%i.%i.%i.%i.        ^n",bar_guesscode[id][0],bar_guesscode[id][1],bar_guesscode[id][2],bar_guesscode[id][3],bar_guesscode[id][4])         len += format(body[len],sizeof(body)-len,"---------------------------------------^n")         add(body,sizeof(body),"^n0. Exit^n")         show_menu(id,key,body)     }     else     {         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public action_bar_guess(id,key) {     if(!is_user_alive(id)) return PLUGIN_HANDLED     new origin[3]     get_user_origin(id,origin)     if(get_distance(origin,bar_tv) > 25.0) return PLUGIN_HANDLED     if(key == 9) return PLUGIN_HANDLED         for(new i = 0;i < 5;i++) {  // Search for the specific slot and set value         if(bar_guesscode[id][i] == 0) {         bar_guesscode[id][i] = key+1         break         }     }         if(bar_guesscode[id][4] != 0)   // If last number then show menu     {         if(bar_guesscode[id][0] == bar_rightpass[0] && bar_guesscode[id][1] == bar_rightpass[1] && bar_guesscode[id][2] == bar_rightpass[2] && bar_guesscode[id][3] == bar_rightpass[3] && bar_guesscode[id][4] == bar_rightpass[4]) bar_menu(id)         else {             for(new i = 0;i < 5;i++) {             bar_guesscode[id][i] = 0             }         }         return PLUGIN_HANDLED     }     else                // If NOT last then reshow menu     {         tv_bar_guess(id)         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public bar_menu(id) {     if(!is_user_alive(id)) return PLUGIN_HANDLED     client_print(id,print_chat,"[TV] Correct Code!")     for(new i = 0;i < 5;i++) {         bar_guesscode[id][i] = 0     }         new body[256]     new key = (1<<0|1<<1|1<<9)     new len = format(body,sizeof(body),"Bar TV Menu^n")         add(body,sizeof(body),"^n1. Nirvana - Smells Like Teen Spirit^n")     add(body,sizeof(body),"2. E-Bass^n")     add(body,sizeof(body),"^n0. Close Menu^n")     show_menu(id,key,body,-1,"action_bar_menu")     return PLUGIN_HANDLED } public action_bar_menu(id,key) {     switch(key)     {         case 0:         {             if(playing != 0)             {                 client_print(id,print_chat,"[TV] A song is already being played, wait for it to end!^n")                 return PLUGIN_HANDLED             }             else             {                 new box = create_entity("info_target")                 entity_set_origin( box, porigin)                 emit_sound(box, CHAN_AUTO, "Pimplordz/Music/smellslike.wav", 1.0, ATTN_IDLE, 0, PITCH_NORM)                 playing = 1                 set_task(300.0, "stop_player")                 client_print(id,print_chat,"[TV] Music is being played!^n")             }         }         case 1:         {             new box = create_entity("info_target")             entity_set_origin( box, porigin)             emit_sound(box, CHAN_AUTO, "Pimplordz/Sound/Bass001.wav", 1.0, ATTN_STATIC, 0, PITCH_NORM)         }         case 2:         {             return PLUGIN_HANDLED         }     }     return PLUGIN_HANDLED   }
Timoses is offline
Send a message via ICQ to Timoses Send a message via MSN to Timoses
 



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:45.


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