Raised This Month: $ Target: $400
 0% 

[Help] Origin to direction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darktemplar
Member
Join Date: Sep 2009
Old 03-14-2013 , 11:04   [Help] Origin to direction
Reply With Quote #1

Hi
I have a question : How can I calculate direction from 2 origin. I have fOrigin[3] and fEndOrigin[3]. I want to convert them to fDirection[3]
Somebody helps me please
darktemplar is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-14-2013 , 11:56   Re: [Help] Origin to direction
Reply With Quote #2

fEndOrigin - fOrigin.

In pawn, you can use xs, xs_vec_sub( fEndOrigin, fOrigin, fDirection ) (if I remember the syntax ).
Then you can normalize with xs_vec_normalize to get a vector of length as 1.
__________________

Last edited by Arkshine; 03-14-2013 at 11:56.
Arkshine is offline
darktemplar
Member
Join Date: Sep 2009
Old 03-15-2013 , 02:47   Re: [Help] Origin to direction
Reply With Quote #3

Thank you , Ark
After post this question, I looked at your CS-SDK and I found the direction calculation . Do you know to make a weapon as shield ? I saw that in your CS-SDK, you use 1 stock that : IsProtectedByShield. But I already did that stock but the player still take damage
darktemplar 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 21:43.


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