stock PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
{
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid,px,py,pz);
return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );//<---------
}
Originally Posted by Backwardsman97
You can't return a float.
|
Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z) { new Float:px,Float:py,Float:pz; GetPlayerPos(playerid,px,py,pz); return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );//<--------- }
forward Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z);
public Float:PlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
{
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid,px,py,pz);
return floatsqroot ( ( (x-px)*(x-px) ) + ( (y-py)*(y-py) ) + ( (z-pz)*(z-pz) ) );
}