iCURiP
2012-01-05 19:44:34
Basically, in my soul wars script sometimes it will get stuck inside buildings such as the graveyards, because i detect if I'm inside them by getting the players tile and checking if its inside the area, but its odd, because it thinks its outside the building then i decrease or increase the tile by 1 and then it thinks its inside when its outside.
Here is an example of how i detect it…
Any help would be greatly appreciated.
iCURiP.
Here is an example of how i detect it…
{*******************************************************************************
Function InArea(T1:TPoint; T2:TPoint):Boolean;
T1 = North-west point of area
T2 = South-eats point of area
Description: Returns true if player is in the area
*******************************************************************************}
Function InArea(T1:TPoint; T2:TPoint):Boolean;
var
P:TPoint;
X1, Y1, X2, Y2 :Integer;
begin
P := SPS_GetMyPos;
X1 := T1.x;
Y1 := T1.y;
X2 := T2.x;
Y2 := T2.y;
Result := (p.x <= X2) and (p.x >= X1) and (p.y <= Y2) and (p.y >= Y1);
Exit;
end;
Function inEastGrave : Boolean;
begin
Result := InArea(Point(850, 4965), Point(860, 4975));
end; Any help would be greatly appreciated.
iCURiP.