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

Is user in fov?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Decak
Senior Member
Join Date: Sep 2012
Old 03-06-2015 , 18:34   Is user in fov?
Reply With Quote #1

How to check is user in fov?
Decak is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 03-06-2015 , 19:47   Re: Is user in fov?
Reply With Quote #2

is_in_viewcone?
__________________
Currently offline for study.
RateX is offline
Decak
Senior Member
Join Date: Sep 2012
Old 03-07-2015 , 05:03   Re: Is user in fov?
Reply With Quote #3

Yeah, thanks, i forgot the syntax
Decak is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 03-12-2015 , 10:54   Re: Is user in fov?
Reply With Quote #4

Here...
Code:
// Get FOV(Arkshine) new fov; fov = pev(id, pev_fov) if (fov == 90) {     //Defualt FOV } else {     //zooming }
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Decak
Senior Member
Join Date: Sep 2012
Old 07-15-2015 , 14:25   Re: Is user in fov?
Reply With Quote #5

I don't want to open new thread, I'll ask here.

Is command 'is_in_viewcone' checking are entity can see the given origin or only is that origin in viewcone?
Decak is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 07-15-2015 , 16:01   Re: Is user in fov?
Reply With Quote #6

Code:
 checks if an origin is in an entity's view cone
in fakemeta_util:
Code:
  1. bool:fm_is_visible( index, const Float:point[3], ignoremonsters = 0 )
grs4 is offline
Decak
Senior Member
Join Date: Sep 2012
Old 07-15-2015 , 19:04   Re: Is user in fov?
Reply With Quote #7

'fm_is_visible' always returning true!
Decak is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 07-16-2015 , 06:07   Re: Is user in fov?
Reply With Quote #8

Code:
new gTraceHandle

public plugin_init() {
     gTraceHandle = create_tr2()
}
//// This function checks if a point is visible from start to point! It will ignore glass and players! Also it will ignore the ignore_ent! 
bool:is_point_visible(const Float:start[3], const Float:point[3], ignore_ent)
{
    engfunc(EngFunc_TraceLine, start, point, IGNORE_GLASS | IGNORE_MONSTERS, ignore_ent, gTraceHandle)

    static Float:fraction
    get_tr2(gTraceHandle, TR_flFraction, fraction)
    
    return (fraction == 1.0)
}
Not tested, just copied from "block walllhack" plugin.

But, fm_is_visible is working for me perfectly...

https://forums.alliedmods.net/showthread.php?t=103380

Last edited by grs4; 07-16-2015 at 06:09.
grs4 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-16-2015 , 08:19   Re: Is user in fov?
Reply With Quote #9

You don't need to manually create a trace when using EngFunc_TraceLine
__________________
HamletEagle 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 15:29.


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