Thread: Bullet Whizz
View Single Post
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-14-2006 , 14:55  
Reply With Quote #7

Code:
stock bool:is_user_visible(id, target) {     new Float:myOrigin[3]     entity_get_vector(id, EV_VEC_origin, myOrigin)         new Float:fViewOfs[3]     entity_get_vector(id, EV_VEC_view_ofs, fViewOfs)         new Float:targetOrigin[3]     entity_get_vector(target, EV_VEC_origin, targetOrigin)         new Float:EyesPos[3]     xs_vec_add(myOrigin, fViewOfs, EyesPos)     new Float:hitOrigin[3]     new hitIndex = trace_line(id, EyesPos, targetOrigin, hitOrigin)         if(hitIndex == target) {         return true     }     return false }

Quote:
Originally Posted by VEN
Code:
fm_is_visible(index, const Float:point[3])
As you can see that function checks whether given point is visible to an entity/player.
If point is an origin of the other player it's not visible because it's enclosed into the solid box.
So function works as it should work.

Your function should work for all solid target-entities except SOLID_TRIGGER.

EDIT:

I implemented
Code:
bool:fm_is_ent_visible(index, entity)
which compatible with all entity solidity types.
Now you can check for any entity <-> entity visiblity.
PS: I might have miss understood you. Yea I used fm_is_user_visible because of that.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline