Raised This Month: $ Target: $400
 0% 

How to detect you are point at a entity ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-27-2011 , 11:33   How to detect you are point at a entity ?
Reply With Quote #1

As the title !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-27-2011 , 11:46   Re: How to detect you are point at a entity ?
Reply With Quote #2

You can use get_user_aiming()
http://www.amxmodx.org/funcwiki.php?...ming&go=search
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-27-2011 , 11:56   Re: How to detect you are point at a entity ?
Reply With Quote #3

sorry for my mistake, this function only use for player right ?
I don't want to detect the player .
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-27-2011 , 12:07   Re: How to detect you are point at a entity ?
Reply With Quote #4

according to this code
Code:
Vector v_forward;
  Vector v_src = edict->v.origin + edict->v.view_ofs;

  ANGLEVECTORS(edict->v.v_angle, v_forward, NULL, NULL);
  TraceResult trEnd;
  Vector v_dest = v_src + v_forward * static_cast<float>(params[4]);
  TRACE_LINE(v_src, v_dest, 0, edict, &trEnd);
i think I have find a right way !
thx your reply
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-27-2011 , 12:13   Re: How to detect you are point at a entity ?
Reply With Quote #5

get_user_aiming() will return any entity. Not only players
__________________
Полный похуизм.

Last edited by Flipper_SPb; 03-27-2011 at 12:17.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
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 14:40.


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