Raised This Month: $51 Target: $400
 12% 

Use in Menu "Weapons" only ONE in round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trickyyy
Junior Member
Join Date: Mar 2012
Old 03-03-2012 , 17:52   Use in Menu "Weapons" only ONE in round
Reply With Quote #1

Hello all !

I have some problem, i need help with my Menu.

I need set my "weapons" in menu to use only one in round.. if someone click button to weapons in menu after the second it will say -> You can use weapon menu only one in round.

here is my menu :

Code:
public cmd_menu(id)
	{
		if(is_user_alive(id))
		{
			static item[64]
			
			formatex(item, charsmax(item), "\wMenu")
			new menu = menu_create(item, "menu_handler")
			
			formatex(item, charsmax(item), "\wWeapons")
			menu_additem(menu, item, "1", 0)
			
			formatex(item, charsmax(item), "\yShop")
			menu_additem(menu, item, "2", 0)
			
			menu_addblank(menu, 0)
			
			formatex(item, charsmax(item), "\wExit")
			menu_additem(menu, item, "3", 0)
Thanks for any help !
PS: sorry for my bad english.
Trickyyy is offline
xfire97
Member
Join Date: Aug 2011
Old 03-03-2012 , 18:00   Re: Use in Menu "Weapons" only ONE in round
Reply With Quote #2

Public the all sma
of the plugin
xfire97 is offline
Trickyyy
Junior Member
Join Date: Mar 2012
Old 03-03-2012 , 18:07   Re: Use in Menu "Weapons" only ONE in round
Reply With Quote #3

Why ? its all what you need .. : )
Trickyyy is offline
xfire97
Member
Join Date: Aug 2011
Old 03-03-2012 , 18:18   Re: Use in Menu "Weapons" only ONE in round
Reply With Quote #4

Wrong... public the all sma
xfire97 is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 03-04-2012 , 02:12   Re: Use in Menu "Weapons" only ONE in round
Reply With Quote #5

Create one bool variable!

PHP Code:
new bool:used[33]; 
Replace to menu code:

PHP Code:
public cmd_menu(id)
    {
        if(
is_user_alive(id) && used[id] == false)
        {
            static 
item[64]
            
            
formatex(itemcharsmax(item), "\wMenu")
            new 
menu menu_create(item"menu_handler")
            
            
formatex(itemcharsmax(item), "\wWeapons")
            
menu_additem(menuitem"1"0)
            
            
formatex(itemcharsmax(item), "\yShop")
            
menu_additem(menuitem"2"0)
            
            
menu_addblank(menu0)
            
            
formatex(itemcharsmax(item), "\wExit")
            
menu_additem(menuitem"3"0
Add to menu_handler cases:
PHP Code:
case 1:
{
      
//Your code
      
used[id] = true;
}

case 
2:
{
      
//Your code
      
used[id] = true;
}

case 
3:
{
      
//Your code
      
used[id] = true;

And create round start event, and reset the variable:

used[id] = false;
__________________
kiki33hun 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 01:46.


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