Raised This Month: $32 Target: $400
 8% 

Solved Prices menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
Member
Join Date: Jun 2018
Old 07-17-2018 , 13:20   Prices menu
Reply With Quote #1

Can someone make a code with menu like:

Prices:

1. VIP

And then when player chooses 1, he receives a message.
You can just make menu with VIP so I can see how to do the rest.
ty.

Last edited by blAck.; 08-05-2018 at 14:08.
blAck. is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-17-2018 , 15:17   Re: Prices menu
Reply With Quote #2

First of all, I hope you want him to receive a coloured chat message. If yes, add this include into your AMXX Studio. Read its documentation and commands and what indexes you need to make chat coloured.

After you have done it, we can go for a code.

PHP Code:

#includes .....

new pricesMenu//Create global variable for menu to be accessible from everywhere

public plugin_init() 
{
  
register_clcmd("say /prices","PricesMenu"); //Register command
}

public 
PricesMenu(id)
{
    if(
is_user_alive(id))
    {
        
pricesMenu menu_create("\yPrices","pricesHandler"); //Create menu 
        
menu_additem(pricesMenu,"\wVIP""vip"0); //Add an item to our menu
        
menu_display(idpricesMenu ,0); //Displays menu
        
return PLUGIN_HANDLED;
    } else 
CC_SendMessage(id"&x07[&x04PricesMenu&x07] &x03You must be alive to view this menu!"); //This is what we have added to our includes.
    
return 1;
}

public 
pricesHandler(idpricesMenuitem)
{
    switch (
item
    { 
              case 
0//First item in menu.. starting off from 0 to unlimited.
              
{
                 
CC_SendMessage(id"&x07[&x04PricesMenu&x07] &x03 YOUR TEXT GOES HERE");
              }
        }
    
menu_destroy(pricesMenu); //destorys menu
    
return 1

Hope you enjoy and next time try to use search function. I'm not surprised noone has answered you such a long time. You have lots and lots of topics how to create menu. I didn't test this shit so hope it works for you.

Last edited by LemoNSK; 07-17-2018 at 15:27.
LemoNSK is offline
blAck.
Member
Join Date: Jun 2018
Old 07-17-2018 , 21:44   Re: Prices menu
Reply With Quote #3

Quote:
Originally Posted by LemoNSK View Post
First of all, I hope you want him to receive a coloured chat message. If yes, add this include into your AMXX Studio. Read its documentation and commands and what indexes you need to make chat coloured.

After you have done it, we can go for a code.

PHP Code:

#includes .....

new pricesMenu//Create global variable for menu to be accessible from everywhere

public plugin_init() 
{
  
register_clcmd("say /prices","PricesMenu"); //Register command
}

public 
PricesMenu(id)
{
    if(
is_user_alive(id))
    {
        
pricesMenu menu_create("\yPrices","pricesHandler"); //Create menu 
        
menu_additem(pricesMenu,"\wVIP""vip"0); //Add an item to our menu
        
menu_display(idpricesMenu ,0); //Displays menu
        
return PLUGIN_HANDLED;
    } else 
CC_SendMessage(id"&x07[&x04PricesMenu&x07] &x03You must be alive to view this menu!"); //This is what we have added to our includes.
    
return 1;
}

public 
pricesHandler(idpricesMenuitem)
{
    switch (
item
    { 
              case 
0//First item in menu.. starting off from 0 to unlimited.
              
{
                 
CC_SendMessage(id"&x07[&x04PricesMenu&x07] &x03 YOUR TEXT GOES HERE");
              }
        }
    
menu_destroy(pricesMenu); //destorys menu
    
return 1

Hope you enjoy and next time try to use search function. I'm not surprised noone has answered you such a long time. You have lots and lots of topics how to create menu. I didn't test this shit so hope it works for you.
Thanks! One more question: How can I make blank line between two items?
blAck. is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 00:34   Re: Prices menu
Reply With Quote #4

Quote:
Originally Posted by blAck. View Post
Thanks! One more question: How can I make blank line between two items?
I suggest you this website if you don't know certain commands for certain includes or something like that

URL: AMXMODX Api Documentation

Find there your command, i think it's under 'newmenus' and read its arguments. You can find there many things you have not known about.

Blank:

PHP Code:
menu_addblank(pricesMenu0/1); 

Last edited by LemoNSK; 07-18-2018 at 00:36. Reason: Little mistake
LemoNSK is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 07-18-2018 , 07:50   Re: Prices menu
Reply With Quote #5

Quote:
Originally Posted by blAck. View Post
Thanks! One more question: How can I make blank line between two items?
Add
PHP Code:
^
at the end of item text in
PHP Code:
menu_additem(pricesMenu,"\wVIP^n""vip"0); //Add an item to our menu 
Airkish is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 12:41   Re: Prices menu
Reply With Quote #6

Quote:
Originally Posted by Airkish View Post
Add
PHP Code:
^
at the end of item text in
PHP Code:
menu_additem(pricesMenu,"\wVIP^n""vip"0); //Add an item to our menu 
or this could do it as well.
LemoNSK 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 18:00.


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