for h:= 1 to numberofbooths do begin if playerx<(bx[h]+radius) then if playery<(by[h]+radius) then if playerx>(bx[h]-radius) then if playery>(by[h]-radius) then if playerz<(bz[h]+20) then if playerz>(bz[h]-20) then begin //INSIDE BOOTH ZONE if zone<>h then begin zone:=h; Form1.Memo1.Lines.Add('Near Booth '+IntToStr(h)); tstring:='Press SPACE to enter phone booth'; writememory($BAA7A0,Length(tstring),junki,junkf,tstring,2); end; end else begin if zone=h then begin zone:=0; writememory($BAA7A0,128,zone,junkf,junks,0); Form1.Memo1.Lines.Add('Left Booth '+IntToStr(h)); end; end; end;