Raised This Month: $ Target: $400
 0% 

[SOLVED]how to check if ent1 can "see" ent2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
powwoww
BANNED
Join Date: Oct 2008
Old 05-24-2009 , 10:41   [SOLVED]how to check if ent1 can "see" ent2
Reply With Quote #1

I want to make a weapon like BFG9000 in Doom3, but I dnt know how to check if theres not any blocks between the shell and the enemy player

sorry for my bad english and thx for care

xPaw: thank u ,but im afraid that is_in_viewcone returns true only if the player looks at the shell, i mean ,the shell should have the effect as irradiation, the enemies must hide themselves to prevent from being hurt
[X]-RayCat: thanks for your information,the code is like the following:

new Float:ret[3]
hitid = trace_line(bhs[j], bhpos[j], zmpos[i], ret)
if(hitid != zms[i])continue //skip if the shell cannot radiate the zombie

Also thank Bugsy

Last edited by powwoww; 05-24-2009 at 12:35. Reason: solved
powwoww is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-24-2009 , 10:44   Re: how to check if ent1 can "see" ent2
Reply With Quote #2

is_in_viewcone
__________________
xPaw is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 05-24-2009 , 10:48   Re: how to check if ent1 can "see" ent2
Reply With Quote #3

I dont know about that.. But you could try with traceline ..
__________________
[X]-RayCat is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 05-24-2009 , 11:57   Re: how to check if ent1 can "see" ent2
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
is_in_viewcone
SnoW is offline
Send a message via MSN to SnoW
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-24-2009 , 12:07   Re: how to check if ent1 can "see" ent2
Reply With Quote #5

See the code in this thread to see it being used in a plugin. It will block a player from taking damage if the victim (ent1) can see the attacker (ent2)

http://forums.alliedmods.net/showthread.php?t=92845
__________________
Bugsy 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 01:28.


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