Distance
#1

Is there any topic to find how much player travelled? I mean on distance from xyz to x1y1z1, how much is travelled.
Reply
#2

Yea you should store the initial points (x,y,z), when he travels record the new points (x,y,z) then get the distance between them GetPlayerDistanceFromPoint
Reply
#3

There is an easy way to get the straight-line distance between two points, but to find out how far the player traveled would be a bit more complex because the player may have taken a roundabout path to get there. For the easier way, you could use https://sampwiki.blast.hk/wiki/GetPlayerPos at the starting point, then https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint at the endpoint.
Reply
#4

I'm looking at this, but the point is, that I want to make how much kilometeres player traveled with vehicle, you got that?
Reply
#5

I think its pretty hard to make it without commands or something to store the initial and the final distances, also to get Kilometers just divide the distance by 1000.
pawn Code:
format(szMessage, sizeof(szMessage), "You're %0.2f killo meters away from the vending machine.", fDistance/1000);
Reply
#6

I find out what I wanted, thank you all for replies.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)