Did you confirm the entity is spawned in a place that can be in your player viewcone? Are you really searching for the entity in plugin_init()? Maybe it doesn't exist yet.
The function works, aim at a player and say "test"
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
new Float:fTestOrigin[3];
public plugin_init()
{
register_plugin("Viewcone Test", "1.0", "ridavcrum");
register_clcmd( "say test" , "Test" );
}
public Test( id )
{
new pID;
set_task( 0.1 , "ViewconeTest" , id , .flags="b");
get_user_aiming( id , pID );
pev(pID, pev_origin, fTestOrigin);
client_print( id , print_chat , "Found ent at {%f, %f, %f}" , fTestOrigin[0],fTestOrigin[1],fTestOrigin[2])
}
public ViewconeTest( id )
{
if ( is_in_viewcone( id , fTestOrigin , 1 ) )
client_print(id, print_chat, "IN VIEWCONE");
}
__________________