AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Origin to direction (https://forums.alliedmods.net/showthread.php?t=210770)

darktemplar 03-14-2013 11:04

[Help] Origin to direction
 
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 :)

Arkshine 03-14-2013 11:56

Re: [Help] Origin to direction
 
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.

darktemplar 03-15-2013 02:47

Re: [Help] Origin to direction
 
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


All times are GMT -4. The time now is 21:43.

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