Quote:
Originally Posted by Bugsy
I'm not sure where in the map the origin is getting created, maybe it is in a tight location and then the -75 offset puts it underground? I've never used this map.
|
I did a minor tweak to your code, also something that affected your code was the maps 'easter egg', which is an underground place.
PHP Code:
public Float:GetMaxHeight( id )
{
new Float:fOrigin[ 3 ] = { 0.0, 0.0, 0.0 }, pcCurrent;
pev( id , pev_origin , fOrigin );
while ( ( engfunc( EngFunc_PointContents , fOrigin ) == CONTENTS_EMPTY ) || ( engfunc( EngFunc_PointContents , fOrigin ) == CONTENTS_SOLID ) )
{
fOrigin[ 2 ] += 5.0;
}
pcCurrent = engfunc( EngFunc_PointContents , fOrigin );
if( pcCurrent == CONTENTS_SKY )
{
return fOrigin[ 2 ] -= 105.0;
}
return 0.0
}
Quote:
Originally Posted by SkumTomteN
HTML Code:
stock Float: get_origin_to_roof(Float:start[3])
{
new Float:dest[3] = {-90.0, 0.0, 0.0}
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)
engfunc(EngFunc_TraceLine, start, dest, 0, 0, 0)
new Float:origin[3]
get_tr2(0, TR_vecEndPos, origin)
return origin
}
|
I already fixed the problem but could you explain how that works? I've never worked with trace lines.
__________________