03.01.2018, 17:25
Hello, how do I do it so that the speed does not restart but stays fixed
Script
new Float:Vel[3];
if(ManejaAtras(GetPlayerVehicleID(playerid)) && Marcha[playerid] >= 1)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 35&& Marcha[playerid] == 1)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 80 && Marcha[playerid] == 2)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 110 && Marcha[playerid] == 3)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 135 && Marcha[playerid] == 4)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(Marcha[playerid] == -1 && !ManejaAtras(GetPlayerVehicleID(playerid)))
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
return 1;
}
else
{
Marcha[playerid] = 0;
ChauTextDraw(playerid);
return 1;
}
}
Script
new Float:Vel[3];
if(ManejaAtras(GetPlayerVehicleID(playerid)) && Marcha[playerid] >= 1)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 35&& Marcha[playerid] == 1)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 80 && Marcha[playerid] == 2)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 110 && Marcha[playerid] == 3)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(SacarV(playerid) >= 135 && Marcha[playerid] == 4)
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
if(Marcha[playerid] == -1 && !ManejaAtras(GetPlayerVehicleID(playerid)))
{
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
SetVehicleVelocity(GetPlayerVehicleID(playerid), Vel[0], Vel[1], Vel[2]);
}
return 1;
}
else
{
Marcha[playerid] = 0;
ChauTextDraw(playerid);
return 1;
}
}