18.04.2011, 13:41
pawn Код:
stock GetPlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z) // I have to define that on code (x, y, z) ...
{
new Float:x1,Float:y1,Float:z1; // To get player pos
new Float:dis; // Distance
GetPlayerPos(playerid,x1,y1,z1); // Getplayer position
dis = floatsqroot((x-x1)*(x-x1)+(y-y1)*(y-y1)+(z-z1)*(z-z1)); // Compare player distance to the point put. error may be here, though
return floatround(dis);
}