Constant speed function
#3

Try this on for size.

pawn Код:
forward BoostTime(playerid);

//When you start the boost
SetPVarInt(playerid,"BoostTime",SetTimerEx("BoostTime",2000,1,"d",playerid));

public BoostTime(playerid)
{
    new
        Float:x,
        Float:y,
        Float:z,
        Float:v = GetPlayerVehicleID(playerid);
       
    GetVehicleVelocity(v,x,y,z);
    SetVehicleVelocity(v,x*1.3,y*1.3,z*1.3);
    return 1;
}

//When you stop the boost
KillTimer(GetPVarInt(playerid,"BoostTime"));
You'll probably want to play around with the time on the timer so he doesn't just constantly accelerate until he goes way too fast.
Reply


Messages In This Thread
Constant speed function - by Swiftz - 16.05.2011, 04:37
Re: Constant speed function - by park4bmx - 16.05.2011, 06:09
Re: Constant speed function - by Backwardsman97 - 16.05.2011, 06:12
Re: Constant speed function - by Swiftz - 16.05.2011, 13:22

Forum Jump:


Users browsing this thread: 1 Guest(s)