AutoPilot system 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AutoPilot system bug. (
/showthread.php?tid=225525)
AutoPilot system bug. -
cepiokas - 13.02.2011
Hey,
I have some problem. I'm turned on timer ( SetTimerEx for playerid ) with 1second interval ( repeating ) and doing this callback
Код:
public AutoPilot(playerid)
{
new Float:velocity[3];
new const vehicleid = GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid,velocity[0],velocity[1],velocity[2]);
SetVehicleVelocity(vehicleid,velocity[0],velocity[1],velocity[2]);
}
But, my speed is slowing down, it seems like it's not working. I have puted prints, everything seems good - printing.
Thanks for answers.
Re: AutoPilot system bug. -
AlExAlExAlEx - 13.02.2011
Well, i'm not good with cars but the car is slowing down and you are just setting its current speed, shouldn't you add some velocity ?
Re: AutoPilot system bug. -
cepiokas - 13.02.2011
Well.. Maybe, but You see, it's should work, because 1s is kinda fast timer, and it cannot slowed down so fast, because then should slowing down 1 by 1 or 2 by 2 and so on.