Raised This Month: $ Target: $400
 0% 

[1 solution found] Calculating an entities mins/maxs according to the entityangles


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-28-2007 , 14:00   Re: Calculating an entities mins/maxs according to the entityangles
Reply With Quote #4

Try this out. It runs EngFunc_FindEntityInSphere on where you aim, and return's the ent's id if found.

PHP Code:
stock get_aim_radius(indexFloat:radius
{
 static 
Float:start[3], Float:view_ofs[3]
 
pev(indexpev_originstart)
 
pev(indexpev_view_ofsview_ofs)
 
xs_vec_add(startview_ofsstart)
 
 static 
Float:dest[3]
 
pev(indexpev_v_angledest)
 
engfunc(EngFunc_MakeVectorsdest)
 
global_get(glb_v_forwarddest)
 
 
xs_vec_mul_scalar(dest9999.0dest)
 
xs_vec_add(startdestdest)
 
 
engfunc(EngFunc_TraceLinestartdest0index0)
 
 static 
Float:origin[3]
 
get_tr2(0TR_vecEndPosorigin)
 
 new 
ent = -1
 
while((ent engfunc(EngFunc_FindEntityInSphereentoriginradius)) != 0)
  return 
ent
 
return 0

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 05-30-2007 at 01:29.
Cheap_Suit is offline
 



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 10:40.


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