Home   Help Search Login Register  

Author Topic: How far off the ground am i?  (Read 349 times)

0 Members and 1 Guest are viewing this topic.

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
How far off the ground am i?
« on: 27 May 2004, 18:18:48 »
How do i detect this?

Cheers :)

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:How far off the ground am i?
« Reply #1 on: 27 May 2004, 18:39:43 »
_logic = "logic" camrcreate [0,0,0]
_logic setpos getpos _unit
_height = _logic distance _unit

As you know, when you are on top of a building, (getpos select 2) returns 0. So by setposing' _logic to _unit's position, _logic will end up on the ground, but at the same X/Y point on the map. Thus, the distance command will only return the difference in height between the two objects.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:How far off the ground am i?
« Reply #2 on: 27 May 2004, 18:46:14 »
thanks :)