[Help] Speed
#1

How can I create system if you press 2 when you are inside the vehicle,that vehicle will drive with just one speed. Example: i'm driving with sultan 110km/h and in a moment I pressed 2 that vehicle will drive without "w" that speed and I will just use right and left. Please let me know how to create it
Reply
#2

https://sampwiki.blast.hk/wiki/SetVehicleVelocity
Reply
#3

Yes,I know for that,but I don't understand how to create it what did I say
Reply
#4

pawn Код:
new Float:Velocity[3], VelTimer[MAX_PLAYERS];//global
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new PlayerState = GetPlayerState(playerid);
if(newkeys & KEY_YES && PlayerState == PLAYER_STATE_DRIVER)
    {
        if(VelTimer[playerid] !=-1) return KillTimer(VelTimer[playerid]);
        GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
        VelTimer[playerid] = SetTimerEx("UpdateVelocity", 500, true, "i", GetPlayerVehicleID(playerid));
    }
}

forward UpdateVelocity(veh);
public UpdateVelocity(veh)
{
    SetVehicleVelocity(veh,Velocity[0], Velocity[1], Velocity[2]);
    return 1;
}
Consider change the update time
But will not go when turning as calculations are involved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)