Log in

View Full Version : SPS Areas?



Mat
02-17-2012, 01:31 PM
Hey
Title says most of it, Like say if I had two points
Area := Point(1,1)*Point(3,3);
then I was in 2,2 how would I make the area and stuff?
Mat

NexPB
02-17-2012, 01:53 PM
I use this

function InArea(Pt1, Pt2: TPoint): Boolean;
var
p: TPoint;
Box: TBox;
begin
p := SPS_GetMyPos;
Box := PointToBox(Pt1, Pt2);

if (PointInBox(p, Box)) then
begin
writeln('Player found in area.');
Result := true;
end else
Result := false;

end;

function AtTeleportArea: boolean;
begin
result := (InArea(Point(275, 955),Point(300, 980)));
end;


Its for my Astral crafter.

Mat
02-17-2012, 01:55 PM
<3 Sweet :) thanks Man!
E:Amazing Function that should be in SPS as it works amazingly!
Mat!