[Help] Speed
#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


Messages In This Thread
[Help] Speed - by Pajser - 28.07.2013, 10:10
Re: [Help] Speed - by park4bmx - 28.07.2013, 10:33
Re: [Help] Speed - by Pajser - 28.07.2013, 19:02
Re: [Help] Speed - by park4bmx - 28.07.2013, 21:20

Forum Jump:


Users browsing this thread: 1 Guest(s)