Raised This Month: $ Target: $400
 0% 

Speed down


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-23-2009 , 03:57   Speed down
Reply With Quote #1

How to do that when player do nothing, speed goes down from the speed what player had.
example players speed is 999. player lose the forward key & speed must go down from 999 to 998 , 997, 9996 >>> 0.
this is what i have but problem is when u dont press the key, ur speed is 0

PHP Code:
/***************************************************************************************************



Group A = Movement
Group B = Speed


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

new Float:A_GAS 0.0
new Float:A_SORAT
new B_DANDEH 0

public plugin_init() 
{
    
register_plugin("Movements""0.1""One")
    
register_forward(FM_CmdStart"fwdCmdStart");
}
public 
fwdCmdStart(id,iHandle)
{
    
A_SORAT get_user_maxspeed(id)
    if(
A_GAS >= 1000.0)
    {
        
A_GAS 1000.0
    
}
    if(
A_GAS <= 0.0)
    {
        
A_GAS 0.0
    
}
    if(
A_SORAT >= 1000.0)
    {
        
A_SORAT 1000.0
    
}
    if(
A_SORAT <= 0.0)
    {
        
A_SORAT 0.0
    
}
    if (
get_uc(iHandleUC_Buttons) & IN_FORWARD)
    {
        
B_DANDEH  1
        A_GAS 
A_GAS 0.3
        set_user_maxspeed
(id,A_GAS)
        if(
A_SORAT >= 120.0)
        {
            
B_DANDEH 2
            A_GAS 
A_GAS 0.5
        
}
        else if(
A_SORAT >= 200.0)
        {
            
B_DANDEH 3
            A_GAS 
A_GAS 0.7
        
}
        else if(
A_SORAT >= 400.0)
        {
            
B_DANDEH 4
            A_GAS 
A_GAS 1.0
        
}
        else if(
A_SORAT >= 700.0)
        {
            
B_DANDEH 5
            A_GAS 
A_GAS 0.2
        
}
        else if(
A_SORAT >= 1000.0)
        {
            
set_user_maxspeed(id,1000.0)
        }
    }
    else
    {
        if(
B_DANDEH >= 5)
        {
            
A_GAS A_GAS 1.0
            A_SORAT 
A_SORAT 20.0
        
}
        else if(
B_DANDEH && 4)
        {
            
A_GAS A_GAS 1.0
            A_SORAT 
A_SORAT 16.0
        
}
        else if(
B_DANDEH && 3)
        {
            
A_GAS A_GAS 1.0
            A_SORAT 
A_SORAT 13.0
        
}
        else if(
B_DANDEH && 2)
        {
            
A_GAS A_GAS 1
            A_SORAT 
A_SORAT 20.0
        
}
        else if(
B_DANDEH && 1)
        {
            
A_GAS A_GAS 2.0
            A_SORAT 
A_SORAT 30.0
        
}
        else if(
B_DANDEH && 0)
        {
            
A_GAS 0.0
            A_SORAT 
0.0
        
}
    }

better said, ur speed must go slowly slower.
__________________
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
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 06-23-2009 , 04:00   Re: Speed down
Reply With Quote #2

im not sure if its what u need, but you could make a "new gVariable = 1000" and a repeating task and do "gVariable--;" then "set_user_maxspeed(id, floatround(gVariable);"
__________________
minimiller is offline
Send a message via MSN to minimiller
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-23-2009 , 04:02   Re: Speed down
Reply With Quote #3

hmmm this sounds good. ill try. ty for first.
__________________
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
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 06-23-2009 , 07:18   Re: Speed down
Reply With Quote #4

Code:
set_user_maxspeed( id, float( gVariable ) );

floatround - Rounds a float into an integer value.
float - Returns the floating point value of the given number.
tpt is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 06-23-2009 , 07:48   Re: Speed down
Reply With Quote #5

my bad
__________________
minimiller is offline
Send a message via MSN to minimiller
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 15:33.


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