Raised This Month: $ Target: $400
 0% 

[SOLVED] dont have a title for this.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-14-2009 , 10:28   [SOLVED] dont have a title for this.
Reply With Quote #1

so first, i dont have a title for this. can anyone give me a title ?

secund :

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>

#define FANGEN_FLAG ADMIN_KICK
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new player_gang
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /a""drehzahl",FANGEN_FLAG)
    
    
// Add your code here...
}
public 
test(id)
{
    
// Abfrage Spieler geschwindigkeit
    
    
new Float:speed
    speed 
get_user_maxspeed(id)
    
    
    
//new Float:gang1, gang2, gang3
    // Gang 1
    
    
if( speed >= && speed <=250)
    {
        
player_gang 1
    
}
    
// Gang 2
    
if( speed >= 250 && speed <= 400)
    {
        
player_gang 2
    
}
    
    
// Gang 3
    
if( speed >= 400 && speed <= 600)
    {
        
player_gang 3
    
}
    
}
public 
drehzahl(id)
{
    
client_print(id,print_chat"public drehzahl wurde ausgefuehrt")
    new 
Float:speed
    speed 
get_user_maxspeed(id)
    
    
    new 
Float:drehzahl
    
if( speed == )
    {
        
drehzahl 1000.00
        client_print
(id,print_chat"lol drehzahl = %d"drehzahl)
    }
    else 
    {
        
drehzahl speed 400 player_gang

        client_print
(id,print_chat"drehzahl = %d"drehzahl)
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1031\\ f0\\ fs16 \n\\ par }
*/ 
i have by print :

drehzahl = 2139095040

why its so ?

player speed is 250 * 400 / 1 = 100 000
this must be the correct value.

& how to short the 100,000 to 1000 ?
__________________

Last edited by One; 05-14-2009 at 13:13.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-14-2009 , 13:09   Re: i dont have a title for this.
Reply With Quote #3

tytytyty.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Reply


Thread Tools
Display Modes

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