Raised This Month: $ Target: $400
 0% 

Use MENU one time per round.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danielo_o
Member
Join Date: Mar 2011
Old 08-25-2012 , 03:48   Use MENU one time per round.
Reply With Quote #1

Please give me an example of using menu one time per round.(posting the code would be helpful)

Best regards, daniel.

Last edited by danielo_o; 08-25-2012 at 03:48.
danielo_o is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-25-2012 , 05:27   Re: Use MENU one time per round.
Reply With Quote #2

You can use bool which you set to true at the menu's command ( where you open it ) and set it to false at the new round. Don't forget to open the menu only if the bool is false.

Last edited by dark_style; 08-25-2012 at 05:27.
dark_style is offline
danielo_o
Member
Join Date: Mar 2011
Old 08-25-2012 , 06:22   Re: Use MENU one time per round.
Reply With Quote #3

Quote:
Originally Posted by dark_style View Post
You can use bool which you set to true at the menu's command ( where you open it ) and set it to false at the new round. Don't forget to open the menu only if the bool is false.
Can't you post the full code?
Thanks.
danielo_o is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-25-2012 , 07:23   Re: Use MENU one time per round.
Reply With Quote #4

Working with booleans isn't hard.. Search for Emp`'s tutorials - pawn picture tutorial and you may want to see his menu tutorial.

Edit: the bool should be set to true at the menu's handler not at the menu command function.

Last edited by dark_style; 08-25-2012 at 09:23.
dark_style is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-26-2012 , 03:48   Re: Use MENU one time per round.
Reply With Quote #5

Here a pseudocode:

PHP Code:
new globalVariable

public menu
{
   if 
gloabalVariable 0
   
{
      
showMenu()
      
gloabalVariable 1
   
}
}

public 
eventNewRound
{
   
gloabalVariable 0


You should be using booleans for that, as already said.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers

Last edited by mottzi; 08-26-2012 at 03:48.
mottzi is offline
Send a message via MSN to mottzi
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 05:53.


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