Raised This Month: $ Target: $400
 0% 

Divide in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 09-13-2012 , 21:36   Divide in menu
Reply With Quote #1

hello.
i got problem with Divide in menu , the code :
PHP Code:
           OpNumber 100

            
new szText555 char ];  
  
            
formatexszTextcharsmaxszText ), "Menu")    

            new 
menu menu_createszText"shop_handler_weapons" );

            
formatexszTextcharsmaxszText ), "Op Number 1 %d"OpNumber 10);                  
        
            
menu_setpropmenuMPROP_EXITMEXIT_ALL );  
  
            
menu_displayidmenu); 
when i use Divide in Variable the menu doesn't pop up.


but if i change this line:

PHP Code:
 formatexszTextcharsmaxszText ), "Op Number 1 %d"OpNumber 10); 
to this:
PHP Code:
 formatexszTextcharsmaxszText ), "Op Number 1 %d"OpNumber 10); 
its will work . there is a problem with Divide.

Sorry for my bad english.
Mr.Waffle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-13-2012 , 21:57   Re: Divide in menu
Reply With Quote #2

You shouldn't be declaring your string with "char", use just the number. Also notice that you don't actually add any items to the menu . . .
__________________

Last edited by fysiks; 09-13-2012 at 22:10.
fysiks is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 09-14-2012 , 07:54   Re: Divide in menu
Reply With Quote #3

i know , it only Example.
there is no way to use Divide ? I will explain myself better.
I have two variables evrey round they get random numbers

OpNumber = 100
OpNumber1 = 15

like this :
PHP Code:
 formatexszTextcharsmaxszText ), "Op Number 1 %d"OpNumber OpNumber1); 
</span></span></span></span>the problem is when i use divide the menu is not pop up..
Mr.Waffle is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 09-14-2012 , 08:02   Re: Divide in menu
Reply With Quote #4

Try using num_to_str( )
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 09-14-2012 , 08:13   Re: Divide in menu
Reply With Quote #5

can u show me how to use it ?
thanks.
Mr.Waffle is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 09-14-2012 , 08:58   Re: Divide in menu
Reply With Quote #6

i see your code again and its wrong , why you declare szText as [ xxx char] ?!

Code:
new szDivideResult[ 3 ] num_to_str( 100 / 25 , szDivideResult, charsmax( szDivideResult ) )     new szOptions[ 45 ] formatex( szOptions, charsmax( szOptions ) , "Here is the result sir : %s", szDivideResult )
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 09-14-2012 at 08:58.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-14-2012 , 19:34   Re: Divide in menu
Reply With Quote #7

There is nothing wrong with the division. Read my first post again (if you even took the time to read it).
__________________
fysiks 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:14.


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