Raised This Month: $ Target: $400
 0% 

[help] making menu to buy godmode stuff


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eewokney
Junior Member
Join Date: May 2005
Old 01-05-2008 , 04:12   [help] making menu to buy godmode stuff
Reply With Quote #1

hi everybody, im making a menu where people can buy things like godmode im stuck ad the part where people choose something out of my buymenu which does work but im using "case" to check what people have choosen but i want to add more then one line behind it, when i try to make it a amxx it says " only a single statement (or expression) can follow each "case", so i need to think of something else,

part of my script:
[small] switch( key )
{
case 0:client_print(0,print_chat, "[AMX] <Dice Dealer> %s has contracted the deadly slap disease!", User)
HasPrize[id][0] = PRIZE_SLAP
HasPrize[id][1] = random(SLAP_TIME) + 5
user_slap(id,5)
set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16)
case 1: client_print( id, print_chat, "Menu Option #2" )
case 2: client_print( id, print_chat, "Menu Option #3" )
case 3: client_print( id, print_chat, "Menu Option #4" )
case 4: client_print( id, print_chat, "Menu Option #5" )
case 5: client_print( id, print_chat, "Menu Option #6" )
case 6: client_print( id, print_chat, "Menu Option #7" )
case 7: client_print( id, print_chat, "Menu Option #8" )
case 8: client_print( id, print_chat, "Menu Option #9" )
case 9: client_print( id, print_chat, "Menu Option EXIT" )
}[small]

Last edited by eewokney; 01-05-2008 at 04:14.
eewokney is offline
Send a message via MSN to eewokney
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 01-05-2008 , 04:58   Re: [help] making menu to buy godmode stuff
Reply With Quote #2

did you put these: { }?

Code:
 switch( key ) { case 0: {      client_print(0,print_chat, "[AMX] <Dice Dealer> %s has contracted the deadly slap disease!", User)      HasPrize[id][0] = PRIZE_SLAP      HasPrize[id][1] = random(SLAP_TIME) + 5      user_slap(id,5)      set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16) } case 1: client_print( id, print_chat, "Menu Option #2" ) case 2: client_print( id, print_chat, "Menu Option #3" ) case 3: client_print( id, print_chat, "Menu Option #4" ) case 4: client_print( id, print_chat, "Menu Option #5" ) case 5: client_print( id, print_chat, "Menu Option #6" ) case 6: client_print( id, print_chat, "Menu Option #7" ) case 7: client_print( id, print_chat, "Menu Option #8" ) case 8: client_print( id, print_chat, "Menu Option #9" ) case 9: client_print( id, print_chat, "Menu Option EXIT" ) }
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
eewokney
Junior Member
Join Date: May 2005
Old 01-05-2008 , 07:44   Re: [help] making menu to buy godmode stuff
Reply With Quote #3

ty that works ! now i have the problam that the powers work bad, zeus mode doesnt stop, slap disease only slaps once and some things dont even work,

this is the sma:
http://creativeatmosphere.clanserver...x_ejl_dice.sma
eewokney is offline
Send a message via MSN to eewokney
eewokney
Junior Member
Join Date: May 2005
Old 01-05-2008 , 07:44   Re: [help] making menu to buy godmode stuff
Reply With Quote #4

question: how do you do that after the player choose a option out of the menu the player says like /help?

case 0:"say_help" ?

Last edited by eewokney; 01-05-2008 at 11:21.
eewokney is offline
Send a message via MSN to eewokney
Old 01-05-2008, 07:45
eewokney
This message has been deleted by GHW_Chronic. Reason: -
eewokney
Junior Member
Join Date: May 2005
Old 01-08-2008 , 12:42   Re: [help] making menu to buy godmode stuff
Reply With Quote #5

is it client_cmd(id, "say help")

????
eewokney is offline
Send a message via MSN to eewokney
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-08-2008 , 16:50   Re: [help] making menu to buy godmode stuff
Reply With Quote #6

Code:
client_cmd(index, "say /help");
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
eewokney
Junior Member
Join Date: May 2005
Old 01-12-2008 , 03:03   Re: [help] making menu to buy godmode stuff
Reply With Quote #7

this is what i now have, it doesnt work, what is it?:
Code:
#include <amxmodx> #include <cstrike> #include <fun> public plugin_init() {    register_clcmd( "say /commands","ShowMenu", -1, "Shows The menu" )    register_clcmd( "say commands","ShowMenu", -1, "Shows The menu" )    register_clcmd( "commands","ShowMenu", -1, "Shows The menu" )    register_menucmd(register_menuid("\yFirst Menu:"), 1023, "MenuCommand" )    return PLUGIN_CONTINUE } public ShowMenu( id ) {    new szMenuBody[256]    new keys    new nLen = format( szMenuBody, 255, "\yFirst Menu:^n" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. /buyxp" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. /sellxp" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. /buyhp" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. /clearpowers" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. /help" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w6. /myheroes" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w7. /playerskills" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w8. /voteknifesonly" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w9. /roll the dice " )    nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit" )    keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)    show_menu( id, keys, szMenuBody, -1 )    return PLUGIN_CONTINUE } public MenuCommand( id, key ) {     new authid[33]      get_user_authid(id,authid,32)    switch( key )    {        case 0:client_cmd(index, "say /buyxp" )        case 1:client_cmd(index, "say /sellxp" )        case 2:client_cmd(index, "say /buyhp" )        case 3:client_cmd(index, "say /clearpowers" )        case 4:client_cmd(index, "say /help" )        case 5:client_cmd(index, "say /myheroes" )        case 6:client_cmd(index, "say /playerskills" )        case 7:client_cmd(index, "say /voteknifesonly" )        case 8:client_cmd(index, "say /roll the dice" )        case 9: client_print( id, print_chat, "Menu Option EXIT" )    }    return PLUGIN_HANDLED }
eewokney is offline
Send a message via MSN to eewokney
slypanther
BANNED
Join Date: Jan 2008
Old 01-12-2008 , 05:40   Re: [help] making menu to buy godmode stuff
Reply With Quote #8

Try this
You had index and its id is short for index
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

public plugin_init()
{
   
register_clcmd"say /commands","ShowMenu", -1"Shows The menu" )
   
register_clcmd"say commands","ShowMenu", -1"Shows The menu" )
   
register_clcmd"commands","ShowMenu", -1"Shows The menu" )

   
register_menucmd(register_menuid("\yFirst Menu:"), 1023"MenuCommand" )

   return 
PLUGIN_CONTINUE
}

public 
ShowMenuid )
{
   new 
szMenuBody[256]
   new 
keys

   
new nLen formatszMenuBody255"\yFirst Menu:^n" )

   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w1. /buyxp" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w2. /sellxp" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w3. /buyhp" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w4. /clearpowers" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w5. /help" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w6. /myheroes" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w7. /playerskills" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w8. /voteknifesonly" )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n\w9. /roll the dice " )
   
nLen += formatszMenuBody[nLen], 255-nLen"^n^n\w0. Exit" )

   
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)

   
show_menuidkeysszMenuBody, -)

   return 
PLUGIN_CONTINUE
}

public 
MenuCommandidkey )
{
   new 
authid[33]  
   
get_user_authid(id,authid,32)


   switch( 
key )
   {
       case 
0:client_cmd(id"say /buyxp" )
       case 
1:client_cmd(id"say /sellxp" )
       case 
2:client_cmd(id"say /buyhp" )
       case 
3:client_cmd(id"say /clearpowers" )
       case 
4:client_cmd(id"say /help" )
       case 
5:client_cmd(id"say /myheroes" )
       case 
6:client_cmd(id"say /playerskills" )
       case 
7:client_cmd(id"say /voteknifesonly" )
       case 
8:client_cmd(id"say /roll the dice" )
       case 
9client_printidprint_chat"Menu Option EXIT" )
   } 

   return 
PLUGIN_HANDLED

slypanther 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 11:03.


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