Oh
Just use Distance(xs, ys, xe, ye: Integer);
If Distance(xCoordOfPointYouWantToStayNear, yCoordOfPointYouWantToStayNear, SPS_GetMyPos.x, SPS_GetMyPos.y) > Radius then
Blah;
Edit: Forgot that you can't use SPS_GetMyPos.x/.y
You'd have to do this:
Simba Code:
Var
CurrentSPSPos: TPoint;
begin
CurrentSPSPos := SPS_GetMyPos;
If Distance(xCoordOfPointYouWantToStayNear, yCoordOfPointYouWantToStayNear, CurrentSPSPos.x, CurrentSPSPos.y) > Radius then
SPS_WalkToPos(Point(xCoordOfPointYouWantToStayNear, yCoordOfPointYouWantToStayNear));
end;