PHP Code:
getGroundOrigin(Float:origin[3])
{
new Float:traceEnd[3]
traceEnd = origin
traceEnd[2] = traceEnd[2] - 8192.0
new traceLineHandle = create_tr2()
engfunc(EngFunc_TraceLine, origin, traceEnd, IGNORE_MONSTERS, 0, traceLineHandle)
get_tr2(traceLineHandle, TR_vecEndPos, origin)
free_tr2(traceLineHandle)
}
The function will change "origin" to hold the ground origin. If you still need the previous value, create a backup before calling
getGroundOrigin.
__________________