SRL Archive - Help

SPS Areas?


Mat

2012-02-17 08:31:04

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

2012-02-17 08:53:45

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

2012-02-17 08:55:38

<3 Sweet :) thanks Man!
E:Amazing Function that should be in SPS as it works amazingly!
Mat!