I'm currently trying to check if the player is aiming outside, like on de_dust2, in B tunnels would be inside.. you get the point(hopefully).
I have this code to check for it but the problem is that it always returns true, even when I'm in B tunnels. I've also tested this on cs_italy and the same result comes.
Code:
#include <amxmodx>
#include <fakemeta>
public plugin_init( )
{
register_plugin( "Test", "1.0", "Kreation" );
register_clcmd( "say /test", "CmdTest" );
}
public CmdTest( id )
{
if( is_aiming_outside( id ) )
{
client_print( id, print_chat, "You're aiming outside, you're awesome!" );
}
else
{
client_print( id, print_chat, "You're not aiming outside, you're still awesome!" );
}
}
stock bool:is_aiming_outside( id )
{
new origin[3], Float:origin2[3];
get_user_origin( id, origin, 3 );
IVecFVec( origin, origin2 );
new i;
while( ( ++i < 45 ) && ( engfunc( EngFunc_PointContents, origin2 ) == CONTENTS_EMPTY ) )
{
origin2[2] + 15.0;
}
return ( engfunc( EngFunc_PointContents, origin2 ) ) ? true : false;
}
Any and all help appreciated.
__________________