SA-MP Forums Archive
how many second long to get to point ? - 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: how many second long to get to point ? (/showthread.php?tid=517627)



how many second long to get to point ? - carl0o0s - 05.06.2014

i use
Float: fDistance = GetPlayerDistanceFromPoint(playerid, 237.9, 115.6, 1010.2),


fDistance is 485.2
and the vehicle speed is 160

is there any way to calculate how many seconds takes ,to get to the destination?

even if approximate


Re: how many second long to get to point ? - Jack_Leslie - 06.06.2014

It should be as simple as 485.2 divided by 160 which is 3.0325, if you want to get the exact time just set a timer that starts when the player moves from starting x y z and gets to finishing x y z and then stops, with each second printing a number to the server.