Quote:
Originally Posted by SchlumPF*
what about a tracehull using HULL_HUMAN / HULL_HEAD from pev_origin to pev_origin? idk whether that works but if it would return results it could be checked easily whetehr the player stucks.
|
tested and works
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
public plugin_init( )
{
register_clcmd( "say noclip", "Cmd_Noclip" );
register_clcmd( "say test", "Cmd_Test" );
}
public Cmd_Noclip( plr )
{
set_user_noclip( plr, get_user_noclip( plr ) ? 0 : 1 );
}
public Cmd_Test( plr )
{
client_print( plr, print_chat, "stuck = %s", is_user_stuck( plr ) ? "true" : "false" );
}
stock is_user_stuck( plr )
{
new Float:origin[3];
pev( plr, pev_origin, origin );
engfunc( EngFunc_TraceHull, origin, origin, IGNORE_MONSTERS, pev( plr, pev_flags ) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN, plr, 0 );
return get_tr2( 0, TR_StartSolid );
}
__________________