OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Pathy on 27 May 2004, 18:18:48

Title: How far off the ground am i?
Post by: Pathy on 27 May 2004, 18:18:48
How do i detect this?

Cheers :)
Title: Re:How far off the ground am i?
Post by: General Barron 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.
Title: Re:How far off the ground am i?
Post by: Pathy on 27 May 2004, 18:46:14
thanks :)