Raised This Month: $51 Target: $400
 12% 

is_in_viewcone needs fixing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 03-24-2013 , 11:03   is_in_viewcone needs fixing
Reply With Quote #1

is_in_viewcone really needs fixing. It always returns 0 even though though the targeted objects are in viewcone. It only returns 1 sometimes. It seems like engine executes this at very slow rates instead of every server frame. No good reason for this to be returning false when you're looking directly at the object.
__________________
urban_ninja is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-24-2013 , 17:03   Re: is_in_viewcone needs fixing
Reply With Quote #2

Quote:
Originally Posted by urban_ninja View Post
is_in_viewcone really needs fixing. It always returns 0 even though though the targeted objects are in viewcone. It only returns 1 sometimes. It seems like engine executes this at very slow rates instead of every server frame. No good reason for this to be returning false when you're looking directly at the object.
Nobody can help you if you don't supply the code that you are trying. There are many plugins that are successfully using this function.
__________________
fysiks is offline
urban_ninja
Senior Member
Join Date: Feb 2009
Old 03-29-2013 , 09:42   Re: is_in_viewcone needs fixing
Reply With Quote #3

PHP Code:
public server_frame()
{
    new 
Float:delay
    
new Float:timer get_gametime()
    if(
timer delay)
    {
        for(new 
i500;i++)
        {
            if(
is_valid_ent(i))
            {
                new class[
33]
                
entity_get_string(iEV_SZ_classname, class, 32)
                if(
equal(class, "weaponbox") || equal(class, "tf_ammobox"))
                {
                    new 
Float:f_origin[3], i_origin[3]
                    
entity_get_vector(iEV_VEC_originf_origin)
                    
                    
f_origin[2] += 6.0
                    
                    i_origin
[0] = floatround(f_origin[0])
                    
i_origin[1] = floatround(f_origin[1])
                    
i_origin[2] = floatround(f_origin[2])
                    for(new 
plrplr 32plr++)
                    {
                        if(
is_user_connected(plr) && is_visible_origin(plr f_origin) && is_in_viewcone(plrf_origin1))
                        {
                            
set_dynamic_light2(plri_origin6202002010)
                        }
                    }
                }
            }
        }
        
delay timer 1.0
    
}

Sorry about my late reply. Got caught up in other things.
__________________

Last edited by urban_ninja; 03-29-2013 at 09:42.
urban_ninja is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 04-07-2013 , 01:22   Re: is_in_viewcone needs fixing
Reply With Quote #4

Try using Ham_FInViewCone and Ham_FVisible instead of is_in_viewcone and is_visible_origin
You can find how to use them here: https://github.com/joaquimandrade/Ha.../ham_const.inc

Last edited by lazarev; 04-07-2013 at 01:23.
lazarev is offline
Reply



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 10:07.


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