Bumping ^ Here are the results
TR_AllSolid turns to true inside ventilations & turns false outside.
TR_flFraction always in 1.0 no matter where I am.
In other words, I wasn't able to accurate detect if a player is inside ducts :/
This is my current stock
PHP Code:
stock bool:player_in_duct(id, &solid, &Float:fraction)
{
static tr
static Float:origin[3]
pev(id, pev_origin, origin)
origin[2] += get_pcvar_float(cvar)
engfunc(EngFunc_TraceHull, origin, origin, 0, HULL_HEAD, id, tr)
solid = get_tr2(tr, TR_AllSolid)
get_tr2(tr, TR_flFraction, fraction)
if(!solid && fraction < 1.0)
return true
return false
}
I tested many distances with the cvar.. With 25-30 I got TR_AllSolid to change
Any help? :c