AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]how to check if ent1 can "see" ent2 (https://forums.alliedmods.net/showthread.php?t=93099)

powwoww 05-24-2009 10:41

[SOLVED]how to check if ent1 can "see" ent2
 
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

xPaw 05-24-2009 10:44

Re: how to check if ent1 can "see" ent2
 
is_in_viewcone

[X]-RayCat 05-24-2009 10:48

Re: how to check if ent1 can "see" ent2
 
I dont know about that.. But you could try with traceline .. :)

SnoW 05-24-2009 11:57

Re: how to check if ent1 can "see" ent2
 
Quote:

Originally Posted by xPaw (Post 833676)
is_in_viewcone


Bugsy 05-24-2009 12:07

Re: how to check if ent1 can "see" ent2
 
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


All times are GMT -4. The time now is 01:28.

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