Hello Allied Modders!
Im trying to get nonsolid brush entity height but...
Code:
PHP Code:
pev( id, pev_origin, o1 )
static Float:end[3], Float:end2[3], tr, Float:dd
xs_vec_sub( o1, Float:{ 0.0, 0.0, -9999.0 }, end )
engfunc( EngFunc_TraceLine, o1, end, IGNORE_MONSTERS, 0, tr )
get_tr2( tr, TR_vecEndPos, end )
set_pev( ent, pev_movetype, MOVETYPE_TOSS )
set_pev( ent, pev_solid, SOLID_BBOX )
set_pev( ent, pev_origin, Float:{ 0.0, 0.0, 0.0 } )
xs_vec_sub( end, Float:{ 0.0, 0.0, 9999.0 }, end2 )
engfunc( EngFunc_TraceLine, end, end2, IGNORE_MONSTERS, 0, tr )
get_tr2( tr, TR_vecEndPos, end2 )
dd = end2[2] - o1[2]
pn_print( 1, "dist:%f org: %f/%f/%f", dd, end[2], end2[2], o1[2] )
entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_NOCLIP)
set_pev( ent, pev_origin, Float:{ 0.0, 0.0, 0.0 } )
Last traceline go through the entity...
Mayby someone can correct my code and tell me what i did wrong.
And as always, thanks!