11.08.2009, 17:02
That one sucks and is inaccurate.
EDIT* Windows 7 messed up my post pretty bad lol, *cleaned*
pawn Код:
Float:DistFromPlayerToPoint(playerid,Float:X,Float:Y,Float:Z) //Slower, but gives you the distance
{
new Float:tmpx,Float:tmpy,Float:tmpz;
GetPlayerPos(playerid,tmpx,tmpy,tmpz);
return floatsqroot(floatpower(X-tmpx,2)+floatpower(Y-tmpy,2)+floatpower(Z-tmpz,2));
}
IsPlayerNearPoint(playerid,Float:X,Float:Y,Float:Z,Float:radius) //Faster to compute
{
new Float:tmpx,Float:tmpy,Float:tmpz;
GetPlayerPos(playerid,tmpx,tmpy,tmpz);
return ((X-tmpx)*(X-tmpx))+((Y-tmpy)*(Y-tmpy))+((Z-tmpz)*(Z-tmpz))<(radius*radius);
}