I use the following code for when a player is stuck in a wall:
PHP Code:
new Float:fOrigin[ 3 ], Float:fNormalVector[ 3 ], trHull;
trHull = create_tr2( );
pev( id, pev_origin, fOrigin );
engfunc( EngFunc_TraceHull, fOrigin, fOrigin, DONT_IGNORE_MONSTERS, HULL_HUMAN, id, trHull );
get_tr2( trHull, TR_vecPlaneNormal, fNormalVector )
free_tr2( trHull )
returns fNormalVector[0] = 0.0, fNormalVector[1] = 0.0, fNormalVector[2] = 0.0
If doing so with a traceline, you actually get the normal vector corresponding to the plane the traceline hits.
How come this is not the case for tracehull, can it be shown from the HLSDK? Is there a way to retrieve the normal to the plane tracehull hits?