Author Topic: [code snippet] CheckInArea  (Read 2536 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
[code snippet] CheckInArea
« on: April 07, 2007, 07:16:59 pm »
Script Name: CheckInArea Function
Script Description: I saw all those "code snippets" and felt the urge to post one aswell. This function checks wether someone is within a certain area on the map and returns a boolean.
Original Author(s): Avarax
Core Version: 2.5.4
Code:

Code: [Select]
function CheckInArea(ID:integer;Xmin,Xmax,Ymin,Ymax:single):boolean;
var X,Y: single;
begin
  GetPlayerXY(ID,X,Y);
  If (Y >= Ymin) and (Y <= Ymax) and (X >= Xmin) and (X <= Xmax) then
    Result:=true;
end;

Not much of work, eh? I'll make good use of it though in some upcoming epic scripts :>
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host