Raised This Month: $ Target: $400
 0% 

Help me to create Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MyPc
Senior Member
Join Date: Sep 2011
Old 11-26-2011 , 14:16   Re: Help me to create Menu
Reply With Quote #4

Quote:
Originally Posted by made.tn View Post
Please help me to create this plugin

description:


And thanks
Code:
#include <amxmodx>
#include <fun>

public plugin_init()
{
	register_clcmd("say /menu", "menu")
}

public menu(id)
{
	new menu = menu_create("Menu Name", "menu_handler")
	
	menu_additem(menu, "Give 100 hp ", "1")
	menu_additem(menu, "Give 500 hp ", "2")
	menu_additem(menu, "Give 1000 hp ", "3")
	
	menu_display(id, menu, 0)
}

public menu_handler(id, menu, item)
{
	new maxdata[64], maxnames[64], access, callback
	
	menu_item_getinfo(menu, item, access, maxdata, sizeof maxdata - 1, maxnames, sizeof maxnames - 1, callback)
	
	new key = str_to_num(maxdata)
	new health = get_user_health(id)
	
	switch (key)
	{
		case 1:
		{
			set_user_health(id, health + 100)
		}case 2:
		{
			set_user_health(id, health + 500)
		}case 3:
		{
			set_user_health(id, health + 1000)
		}
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
MyPc 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 08:33.


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