Raised This Month: $ Target: $400
 0% 

Get origin in player's viewcone?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-25-2019 , 18:13   Re: Get origin in player's viewcone?
Reply With Quote #4

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 
Testid )
{
    new 
pID;
    
    
set_task0.1 "ViewconeTest" id , .flags="b");
    
get_user_aimingid pID );
    
pev(pIDpev_originfTestOrigin);
    
    
client_printid print_chat "Found ent at {%f, %f, %f}" fTestOrigin[0],fTestOrigin[1],fTestOrigin[2])
}

public 
ViewconeTestid )
{
    if ( 
is_in_viewconeid fTestOrigin ) )
        
client_print(idprint_chat"IN VIEWCONE");

__________________
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode