Raised This Month: $ Target: $400
 0% 

[help] making menu to buy godmode stuff


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
slypanther
BANNED
Join Date: Jan 2008
Old 01-12-2008 , 05:40   Re: [help] making menu to buy godmode stuff
Reply With Quote #9

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
 



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