Raised This Month: $ Target: $400
 0% 

how to find Angle of origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0920357689
Senior Member
Join Date: Apr 2008
Old 04-30-2012 , 16:39   how to find Angle of origin
Reply With Quote #1

origin1[3]
origin2[3]

how to find origin2 on origin1 is what Angle?

Last edited by 0920357689; 04-30-2012 at 16:40.
0920357689 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-30-2012 , 16:46   Re: how to find Angle of origin
Reply With Quote #2

Float:angle = floatatan((origin1[1] - origin2[1]) / (origin1[2] - origin2[2]), DEGREES)

make sure to #include <float>

Last edited by Liverwiz; 04-30-2012 at 16:47.
Liverwiz is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 04-30-2012 , 18:14   Re: how to find Angle of origin
Reply With Quote #3

is my bad
need add one angle on formula
Quote:
new Attack_Origin[3], Victim_Origin[3];
get_user_origin (attacker, Attack_Origin);
get_user_origin (victim, Victim_Origin);

new Float:Attack_FOrigin[3], Float:Victim_FOrigin[3];
IVecFVec (Attack_Origin, Attack_FOrigin);
IVecFVec (Victim_Origin, Victim_FOrigin);

new Float:angle = floatatan((Attack_FOrigin[1] - Victim_FOrigin[1]) / (Attack_FOrigin[2] - Victim_FOrigin[2]), degrees);
client_print(0 , print_chat , "%f",angle);

Last edited by 0920357689; 04-30-2012 at 18:19.
0920357689 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-30-2012 , 18:29   Re: how to find Angle of origin
Reply With Quote #4

Quote:
Originally Posted by 0920357689 View Post
is my bad
need add one angle on formula
seems like you did way too much work there. You can typecast an int as a float. Example:
Code:
Float:num = float(origin[x])
hopefully you can deploy that concept accordingly......it'll save you a bit of finger work, and processing.
Liverwiz is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 04-30-2012 , 18:57   Re: how to find Angle of origin
Reply With Quote #5

Quote:
Originally Posted by Liverwiz View Post
seems like you did way too much work there. You can typecast an int as a float. Example:
Code:
Float:num = float(origin[x])
hopefully you can deploy that concept accordingly......it'll save you a bit of finger work, and processing.
i need the Formula is....
Attached Thumbnails
Click image for larger version

Name:	123.jpg
Views:	140
Size:	14.7 KB
ID:	102947  
0920357689 is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-01-2012 , 12:43   Re: how to find Angle of origin
Reply With Quote #6

PHP Code:
new Float:angles[3]
entity_get_vector(attacker,EV_FL_angles,angles
Will return attacker's entity (player) angles.
__________________

Last edited by <VeCo>; 05-01-2012 at 12:44.
<VeCo> is offline
Reply


Thread Tools
Display Modes

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 07:47.


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