Raised This Month: $ Target: $400
 0% 

Help me to create Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
made.tn
BANNED
Join Date: Nov 2011
Old 11-26-2011 , 13:56   Help me to create Menu
Reply With Quote #1

Please help me to create this plugin

description:
Quote:
Menu Item1:Give 100hp
Menu Item2:Give 500hp
Menu Item3: Give 1000hp
And thanks

Last edited by made.tn; 11-26-2011 at 14:11.
made.tn is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-26-2011 , 14:13   Re: Help me to create Menu
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=46364
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
made.tn
BANNED
Join Date: Nov 2011
Old 11-26-2011 , 14:15   Re: Help me to create Menu
Reply With Quote #3

thanks
made.tn is offline
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
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-26-2011 , 20:50   Re: Help me to create Menu
Reply With Quote #5

@MyPc:

This is the scripting help section.
Here we help people develop their own plugin by giving them the info needed for it,
not give them complete codes.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 11-26-2011 at 20:50.
drekes is offline
Send a message via MSN to drekes
MyPc
Senior Member
Join Date: Sep 2011
Old 11-27-2011 , 00:03   Re: Help me to create Menu
Reply With Quote #6

Quote:
Originally Posted by drekes View Post
@MyPc:

This is the scripting help section.
Here we help people develop their own plugin by giving them the info needed for it,
not give them complete codes.
ok sorry, wont do it next time.
MyPc is offline
made.tn
BANNED
Join Date: Nov 2011
Old 11-27-2011 , 03:21   Re: Help me to create Menu
Reply With Quote #7

thanks evry body
made.tn 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 08:33.


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