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(iHandle, UC_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.
__________________