01.07.2013, 11:17
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.
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; }