View Single Post
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-18-2017 , 08:15   Re: [ H3LP ] Check entity in origin distance
Reply With Quote #5

Quote:
Originally Posted by DarthMan View Post
I used find entity in sphere, but I don't know how to get them in a line from fOrigin to fRet. So this acts like a TraceLine, and I only want to look at entities from that line. If I user vector_distance the normal way it won't work as I want to. I can try getting all entities origin, and check if there is a close distance between the entity origin and fRet, but, wouldn't that check it in a sphere? Like it can return a wrong entity.
PHP Code:

new Float:MaxDistance 500.0Float:fDistance;
new 
entFloat:origin_1[3], Float:origin_2[3], iTarget;
while( (
ent engfunc(EngFunc_FindEntityInSphereentorigin_1MaxDistance) > 0)
{
      
pev(entpev_originorigin_2)
      if((
fDistance get_distance_f(origin_1origin_2)) < MaxDistance)
      {
                 
iTarget ent;
                 
MaxDistance fDistance;
      }


Origin_1 is where your point 1 is located
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-18-2017 at 08:17.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh