Author Topic: RayCast Distance  (Read 670 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
RayCast Distance
« on: August 12, 2007, 12:44:39 pm »
I did a little testing..

Code: [Select]
procedure OnPlayerSpeak(ID: byte; Text: string);
var
  Dist: single;
begin
  //function RayCast(P1X,P1Y,P2X,P2Y: Single; var Distance: Single;MaxDist: Integer): Boolean;
  if RayCast(GetPlayerStat(1,'X') - 20,GetPlayerStat(1,'Y'),GetPlayerStat(1,'X'),GetPlayerStat(1,'Y'),Dist,10000) then Command('/say GOOD');
  Command('/say ' + FloattoStr(Dist));
end;

And it seems when RayCast returns false, Dist is a number larger than 20. Wondering why..