Float:bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Float:bug (
/showthread.php?tid=447703)
Float:bug -
Chax - 01.07.2013
Good day, I have the following problem.
I have a timer that repeats every 300 milliseconds here is when he sits in the car.
When I insert the first gear, the engine starts, so far so good.
But if I Drive faster, the engine does not go out anyway.
He gives me in-game fspeed but still a higher value at high speed.
Код:
public AutoT(i)
{
new Float:fPos[3],Float:Pos[4][2],Float:fSpeed;
GetVehicleVelocity(GetPlayerVehicleID(i), fPos[0], fPos[1], fPos[2]);
fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +floatpower(fPos[2], 2)) * 200;
new Float:Stufe1,Float:Stufe2;
Stufe1=1104340779;
Stufe2=1112427796;
if(fSpeed<Stufe1)
{
if(GetPVarInt(i,"Gang")==1)
{
SetVehicleMotor(GetPlayerVehicleID(i),1);
return 1;
}
else
{
SetVehicleMotor(GetPlayerVehicleID(i),0);
return 1;
}
}
SetVehicleMotor(GetPlayerVehicleID(i),0);
return 1;
}