Raised This Month: $ Target: $400
 0% 

Get the angle of a line between two origins


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-19-2009 , 21:54   Get the angle of a line between two origins
Reply With Quote #1

I am trying to get the angle of a line between 2 origins. I have searched and tried quite a few ways but nothing is working for me. I was able to get the angle of my aim using pev_v_angle but that will only return the angle I am currently aiming; I need it to compute the angle based on 2 inputted origins. Is there a way to do this?

Example, I would need the angle of the line shown below (would prob be ~45 degree or so)


Among a few other ways, I've tried using fm_get_view_angle_diff() and the below code with no luck.

PHP Code:
new Float:fOrigin1[3];
new 
Float:fOrigin2[3];
pev(id,pev_originfOrigin1);
fm_get_aim_origin(idfOrigin2 );
fAngle xs_vec_anglefOrigin1fOrigin2);
client_print(0,print_chat,"Angle: %f" fAngle ); 
+karma for anyone who can help
__________________

Last edited by Bugsy; 02-20-2009 at 10:25.
Bugsy is offline
 


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


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