Question
#1

How I can do this:

A checkpoint has been set to the destination. Distance (x m).

How I can take the distance from player to checkpoint?
Reply
#2

Use GetDistanceBetweenPoints.

Код:
stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
{
	return VectorSize(x1-x2, y1-y2, z1-z2);
}

new Float:distance = GetDistanceBetweenPoints(x1, y1, z1, x2, y2, z2);

printf("distance: %.1f", distance);
Reply
#3

ty

where can i find a wiki page for this? i want to learn more about that one
Reply
#4

It`s better to use
PHP код:
GetPlayerDistanceFromPoint 
instead of
PHP код:
GetDistanceBetweenPoints 
here.

here you have the wiki link:

https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
Reply
#5

ty so muuch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)