Raised This Month: $ Target: $400
 0% 

the making of a submenu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tyler_durden (gsr)
Junior Member
Join Date: Apr 2005
Old 06-26-2005 , 08:31   the making of a submenu
Reply With Quote #1

help me plase i tried everithing and I can't make a sube menu

Code:
#include <amxmodx> #include <fun> #include <cstrike> #include <engine> #define Keysmain_menu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)   // Keys: 12345678 #define Keysmain_menu_2 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6) // Keys: 1234567 new AUTHOR[]="Tyler" new PLUGIN[]="amx_admin_protection_hacks" new VERSION[]="1.00" public plugin_init() {         register_plugin(PLUGIN,VERSION,AUTHOR)     register_cvar("amx_admin_protection_hacks","1")             register_cvar("amx_invis_ratio","0.5")     register_cvar("amx_grav_ratio","1")         register_clcmd( "main_menu","Showmain_menu")     register_clcmd( "main_menu_2","Showmain_menu_2")         register_menucmd(register_menuid("main_menu"), Keysmain_menu, "Pressedmain_menu")     register_menucmd(register_menuid("main_menu_2"), Keysmain_menu_2, "Pressedmain_menu_2")           }   public Showmain_menu(id) {     show_menu(id, Keysmain_menu, "1: godmode^n2: noclip^n3: speed^n4: invisibility^n5: glow^n6: warning^n7: removewarning^n8: Exit^n", -1, "main_menu") // Display menu } public Showmain_menu_2(id) {     show_menu(id, Keysmain_menu_2, "1: strobeinvis^n2: strobeglow^n3: gravity^n4: fprotect^n5: fprotectinvis^n6: fprotectglow^n7: Exit^n", -1, "main_menu") // Display menu } public Pressedmain_menu(id, key) {     /* Menu:     * 1: Godmode     * 2: Noclip     * 3: speed     * 4: invisiblity     * 5: glow     * 6: warning     * 7: removes the  Warning     * 8: main_menu_2     * 9: Exit     */           if (get_cvar_num("amx_admin_protection_hacks") == 0 )         return PLUGIN_HANDLED     switch (key) {         case 0: client_cmd(id,"godmode")         case 1: client_cmd(id,"noclip")               case 2: client_cmd(id,"speed")                           case 3: client_cmd(id,"invisibility")                           case 4: client_cmd(id,"glow")                           case 5: client_cmd(id,"warning")               case 6: client_cmd(id,"removewarning")                     case 0: { // 1         set_user_godmode(id, 1)                       }         case 1: { // 2         set_user_noclip (id,1)                       }         case 2: { // 3         server_cmd("sv_maxspeed 99999999") new i_speed()= 400         set_user_maxspeed(id,i_speed)  // Make person change speed                       }         case 3: { // 4         set_entity_visibility(id, 0) // Make person invisible                     }         case 4: { // 5             set_user_rendering(id,kRenderFxGlowShell,0,0,255,kRenderNormal,25                       }         case 5: { // 6                 client_print (0, print_chat, "Do not annoy The glowing admin")                     }         case 6: { // 7          new player()=get_user_index             client_print (0, print_chat, " %p is now no more in console",player)                     }         case 7: { // 8          /*      *      * -------> MAIN MENU 2      *          */             }             }     return PLUGIN_HANDLED } public Pressedmain_menu_2(id, key) {     /* Menu:     * 1: Strobe invisibility     * 2: Strobe glow     * 3: Gravity for one person (set with the cvar amx_grav_ratio )     * 4: Protection (godmode, Noclip)     * 5: Full Protection (godmode, noclip , invisibility)     * 6: Glow Protection (godmode,noclip ,glow red)     * 7: Exit     */           if (get_cvar_num("amx_admin_protection_hacks") == 0 )         return PLUGIN_HANDLED     switch (key) {         case 0: client_cmd(id,"strobeinvis")         case 1: client_cmd(id,"strobeglow")               case 2: client_cmd(id,"gravity")                           case 3: client_cmd(id,"fprotect")                           case 4: client_cmd(id,"fprotectinvis")                           case 5: client_cmd(id,"fprotectglow")                         case 0: { // 1         set_user_rendering(id, kRenderTransColor,0,0,0, kRenderFxStrobeSlow,0)                       }         case 1: { // 2         set_user_rendering(id, kRenderTransColor,255,0,0, kRenderFxStrobeSlow,255)                       }         case 2: { // 3 new gravity()= 50         set_user_gravity (id, gravity)                     }         case 3: { // 4         set_user_noclip(id,1)     set_user_godmode(id, 0)  //Make person god like         }         case 4: { // 5         set_user_godmode(id, 0)  //Make person god like     set_entity_visibility(id, 0) // Make person invisible                       set_user_noclip(id,1)                        new player()=get_user_index         client_print (0, print_chat, " [ADMIN]%p is now in console",player)     }         case 5: { // 6         set_user_godmode(id, 0)  //Make person god like     set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)     set_user_noclip(id,1)         }         case 6: { // 7          new player()=get_user_index         client_print (0, print_chat, " %p is now no more in console,player)                         }         case 7: { // 8                /*      *      * -------> MAIN MENU 2      *      */               }         case 8: { // 9                               }         case 9: { // 0                               }     }     return PLUGIN_HANDLED }

i can't get rid of all these errors
Code:
/home/groups/amxmodx/tmp/phpiYub92.sma(61) : error 040: duplicate "case" label (value 0)
/home/groups/amxmodx/tmp/phpiYub92.sma(64) : error 040: duplicate "case" label (value 1)
/home/groups/amxmodx/tmp/phpiYub92.sma(67) : error 040: duplicate "case" label (value 2)
/home/groups/amxmodx/tmp/phpiYub92.sma(69) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(69) : error 001: expected token: ";", but found "("
/home/groups/amxmodx/tmp/phpiYub92.sma(69) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp/phpiYub92.sma(70) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(70) : warning 213: tag mismatch
/home/groups/amxmodx/tmp/phpiYub92.sma(72) : error 040: duplicate "case" label (value 3)
/home/groups/amxmodx/tmp/phpiYub92.sma(75) : error 040: duplicate "case" label (value 4)
/home/groups/amxmodx/tmp/phpiYub92.sma(77 -- 78) : error 001: expected token: ",", but found "}"
/home/groups/amxmodx/tmp/phpiYub92.sma(79) : error 040: duplicate "case" label (value 5)
/home/groups/amxmodx/tmp/phpiYub92.sma(83) : error 040: duplicate "case" label (value 6)
/home/groups/amxmodx/tmp/phpiYub92.sma(84) : error 001: expected token: ";", but found "("
/home/groups/amxmodx/tmp/phpiYub92.sma(84) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp/phpiYub92.sma(84 -- 86) : warning 215: expression has no effect
/home/groups/amxmodx/tmp/phpiYub92.sma(86) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(122) : error 040: duplicate "case" label (value 0)
/home/groups/amxmodx/tmp/phpiYub92.sma(125) : error 040: duplicate "case" label (value 1)
/home/groups/amxmodx/tmp/phpiYub92.sma(128) : error 040: duplicate "case" label (value 2)
/home/groups/amxmodx/tmp/phpiYub92.sma(129) : error 001: expected token: ";", but found "("
/home/groups/amxmodx/tmp/phpiYub92.sma(129) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp/phpiYub92.sma(130) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(130) : warning 213: tag mismatch
/home/groups/amxmodx/tmp/phpiYub92.sma(132) : error 040: duplicate "case" label (value 3)
/home/groups/amxmodx/tmp/phpiYub92.sma(136) : error 040: duplicate "case" label (value 4)
/home/groups/amxmodx/tmp/phpiYub92.sma(141) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(141) : error 001: expected token: ";", but found "("
/home/groups/amxmodx/tmp/phpiYub92.sma(141) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp/phpiYub92.sma(141 -- 143) : warning 215: expression has no effect
/home/groups/amxmodx/tmp/phpiYub92.sma(143) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(145) : error 040: duplicate "case" label (value 5)
/home/groups/amxmodx/tmp/phpiYub92.sma(151) : error 001: expected token: ";", but found "("
/home/groups/amxmodx/tmp/phpiYub92.sma(151) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp/phpiYub92.sma(151 -- 153) : warning 215: expression has no effect
/home/groups/amxmodx/tmp/phpiYub92.sma(153) : warning 217: loose indentation
/home/groups/amxmodx/tmp/phpiYub92.sma(153) : error 037: invalid string (possibly non-terminated string)
/home/groups/amxmodx/tmp/phpiYub92.sma(153) : fatal error 107: too many error messages on one line

Compilation aborted.
26 Errors.
__________________
IM on xooit.xooit.com
Tyler_durden (gsr) is offline
Send a message via MSN to Tyler_durden (gsr)
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-26-2005 , 23:29  
Reply With Quote #2

Ok well in your code you have case 0-6: then you listed them twice so remove one of each of them.

second on for case 7 of the first menu use
Code:
case 7: Showmain_menu_2(id)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 06-27-2005 , 01:43  
Reply With Quote #3

case can only be one line, so you cant use:
Code:
case 1: { client_cmd(id,"somthing") client_cmd(id,"somthing") }

just
Code:
case 1: client_cmd(id,"somthing")
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
Tyler_durden (gsr)
Junior Member
Join Date: Apr 2005
Old 06-27-2005 , 04:53  
Reply With Quote #4

how can I put two things in one case then, do I have to call them separately
__________________
IM on xooit.xooit.com
Tyler_durden (gsr) is offline
Send a message via MSN to Tyler_durden (gsr)
DahVid
Senior Member
Join Date: Jun 2005
Old 06-27-2005 , 04:55  
Reply With Quote #5

Call a function in a case. Put the crap you want in the function, simple huh?
DahVid is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-27-2005 , 09:23  
Reply With Quote #6

You guys thats bs...you can have more than one line in a case dont tell people wrong info it will just confuse them later in life.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 06-27-2005 , 12:57  
Reply With Quote #7

Hmm, two separate menus. Messy :/
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 06-27-2005 , 13:31  
Reply With Quote #8

sry but gravity isn't it a float?
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-27-2005 , 21:01  
Reply With Quote #9

Yea, it is.. And if you're still having trouble: http://forums.alliedmods.net/showthread.php?t=14670
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
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 00:27.


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