[HELP] Doesn't set the angle with atan? - 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: [HELP] Doesn't set the angle with atan? (
/showthread.php?tid=171560)
[HELP] Doesn't set the angle with atan? -
RoCK'N'Rolla - 26.08.2010
pawn Код:
if(firstracer[i]==1)
{
firstcar=CreateVehicle(522,RaceCheckpoints[CurrentCheckpoint[i][0] ,RaceCheckpoints[CurrentCheckpoint[i][1],RaceCheckpoints[CurrentCheckpoint[i][2],0,0,0,20);
PutPlayerInVehicle(i,firstcar,0);
SetVehicleZAngle(firstcar,atan((RaceCheckpoints[1][1] - RaceCheckpoints[0][1]) / (RaceCheckpoints[1][0] - RaceCheckpoints[0][0])));
}
It might set start angle of the race ( with atan((y2 - y1) / (x2 - x1)) ), whats wrong here?
Re: [HELP] Doesn't set the angle with atan? -
RoCK'N'Rolla - 27.08.2010
any help?
Respuesta: [HELP] Doesn't set the angle with atan? -
Zoutdaxv - 18.09.2010
use this
atan(floatdiv(y2-y1,x2-x1))