Raised This Month: $ Target: $400
 0% 

[SOLVED] dont have a title for this.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-14-2009 , 10:37   Re: i dont have a title for this.
Reply With Quote #2

Use %f to display floats

Divide the 100,000 by 1000 to get 1000

When working with floats make sure you are consistent when comparing and assigning values. Always use a decimal when comparing a float variable with a number if ( fValue = 1.0 ) and make sure the variable is a float on each side of a comparison\operation. Use float() to convert an integer value to a float. if ( float( iValue ) == fValue )
PHP Code:
public test(id)
{
    
// Abfrage Spieler geschwindigkeit
    
    
new Float:speed
    speed 
get_user_maxspeed(id)
    
    
//new Float:gang1, gang2, gang3
    // Gang 1
    
    
if( speed >= 0.0 && speed <=250.0)
    {
        
player_gang 1
    
}
    
// Gang 2
    
if( speed >= 250.0 && speed <= 400.0)
    {
        
player_gang 2
    
}
    
    
// Gang 3
    
if( speed >= 400.0 && speed <= 600.0)
    {
        
player_gang 3
    
}
    
}

public 
drehzahl(id)
{
    
client_print(id,print_chat"public drehzahl wurde ausgefuehrt")
    new 
Float:speed get_user_maxspeed(id)
    new 
Float:drehzahl

    
if( speed == 0.0 )
    {
        
drehzahl 1000.0
        client_print
(id,print_chat"lol drehzahl = %f"drehzahl)
    }
    else 
    {
        
drehzahl speed 400.0 float(player_gang)

        
client_print(id,print_chat"drehzahl = %f"drehzahl)
    }

__________________

Last edited by Bugsy; 05-14-2009 at 10:51.
Bugsy 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 01:32.


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