a mobj's z
coordinate holds their z position in the world
a mobj's floorz
field holds what's the closest floor from their point of view - that is, the first thing below them that would stop their movement (that is not an object? i forgot)
Assuming the variable mobj
exists and has a mobj, the expression
mobj.z - mobj.floorz
should give you the distance between mobj and floor.
You can get the mobj a player is controlling with player.mobj
(assuming the variable player
exists and has a player)