PlayerToPoint
#1

Hello all, I have always wondered, how does OnPlayerToPoint REALLY work? I know the X,Y,Z Coords part, but the stuff about and how to get the radius coord.

I know that
pawn Code:
if(PlayerToPoint(******))
"opens" other stuffs, just like if IsPlayerAdmin etc. But how do you get the "radius" coord? And how does it really work?

Yes, I have searched, both forums & wiki.

Klutty
Reply
#2

I think the radius works like the radius of a circle and the Coords being the center point. Say for example You put 3 as the radius it would have +3 x,y each way from the center point (coords).

Thats the way I think it works but if im not right' I'd like to know aswell.
Reply
#3

It's supposed to use a distance algorithm for 3 coordinates, X, Y, and Z. By giving the playerid, you're giving the function the coordinates for the player. So the distance between the player's X,Y,Z coordinates and the X,Y,Z coordinates should be less than the radius you asked for (i.e. 10) and it will return 1, meaning the player IS closer than 10 to the point given. Otherwise it returns 0, meaning the player is further than 10 from the point.
Reply
#4

Quote:
Originally Posted by SilentHuntR
It's supposed to use a distance algorithm for 3 coordinates, X, Y, and Z. By giving the playerid, you're giving the function the coordinates for the player. So the distance between the player's X,Y,Z coordinates and the X,Y,Z coordinates should be less than the radius you asked for (i.e. 10) and it will return 1, meaning the player IS closer than 10 to the point given. Otherwise it returns 0, meaning the player is further than 10 from the point.
Thank you, but what I mean is, do you get the radius coord via /save?
Reply
#5

radius is the distance the player must be within the point given for the function to return 1.
Reply
#6

Quote:

if(PlayerToPoint(******))

It is good function on distance player from please, position x,y,z ;e
Reply
#7

So I could use 2 as a radius, if im for example making a pickup for an /enter cmd ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)