Raised This Month: $ Target: $400
 0% 

Solved [Help] Need to improve Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
anash
Junior Member
Join Date: May 2018
Old 05-23-2018 , 19:42   [Help] Need to improve Menu
Reply With Quote #1

Hello.
This is a simple menu code that i found, it only shows a menu when players say /menu,
I have 0 knowledge about coding or scripting.
I want the menu to give only one item per round, and it should be accessible only in the buy time, or for 15 seconds from the beginning of the round

Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
	register_plugin("My Menu", "1.0", "Me");
	register_clcmd("say /menu", "ShowMenu", _, "");
}

public ShowMenu(id)
{
	new menu = menu_create("SUPER GAMING MENU", "MENU");

	menu_additem(menu, "Armor ", "", 0); // case 0
	menu_additem(menu, "Hegrenade 1", "", 0); // case 1
	menu_additem(menu, "Flash 1", "", 0); // case 2
	menu_additem(menu, "Extra Money +800$", "", 0); // case 3
	menu_additem(menu, "Extra Ammo  Primary + Secondary", "", 0); // case 4
	menu_additem(menu, "", "", 0); // case 5

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_setprop(menu, MPROP_PERPAGE, 5);
	menu_setprop(menu, MPROP_NOCOLORS, 1);

	menu_display(id, menu, 0);

	return PLUGIN_HANDLED;
}

public MENU(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_cancel(id);
		return PLUGIN_HANDLED;
	}

	new command[6], name[64], access, callback;

	menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

	switch(item)
	{
		case 0: client_print(id, print_chat, "You have selected Armor ");
		case 1: client_print(id, print_chat, "You have selected Hegrenade 1");
		case 2: client_print(id, print_chat, "You have selected Flash 1");
		case 3: client_print(id, print_chat, "You have selected Extra Money +800$");
		case 4: client_print(id, print_chat, "You have selected Extra Ammo  Primary + Secondary");
		case 5: client_print(id, print_chat, "You have selected ");
	}

	menu_destroy(menu);

	return PLUGIN_HANDLED;
}
Thanks in advance

Last edited by anash; 05-23-2018 at 23:05.
anash 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 04:43.


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