weequ
2009-06-29 16:41:49
It would aim the compass to given coords in minimap :)
These are from Ultra cut n bank:
These are from Ultra cut n bank:
{*******************************************************************************
function CoordsToDegrees(x, y: integer): integer;
By: PriSoner
Description: Returns the direction in degrees (0 to 359) to a set of coordinates
relative to your players position on the screen and North.
(degrees are in reverse to the convention to stay compatible with
MakeCompass etc i.e. 0 = N, 90 = W, 180 = S & 270 = E)
*******************************************************************************}
function CoordsToDegrees(x, y: integer): integer;
var d: double;
begin
x := x - 260;
y := y - 160;
d := ArcTan2(y, x) * (180 div Pi) + 90;
if d < 0 then d := d + 360;
result := round(abs(d - 360) + rs_GetCompassAngleDegrees);
if result >= 360 then result := result - 360;
end;procedure MakeCompassCoords(x, y: integer);
By: PriSoner
Description: Moves Compass so that target x & y coordinates are directly north
of your player.
*******************************************************************************}
procedure MakeCompassCoords(x, y: integer);
begin
MakeCompass(IntToStr(CoordsToDegrees(x, y)));
end;
