AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ H3LP ] Velocity by angles (https://forums.alliedmods.net/showthread.php?t=308474)

CrazY. 06-21-2018 09:51

[ H3LP ] Velocity by angles
 
Hello, I'm trying to set velocity by the key the player is pressing. I tried this, it's working but not properly. When I set velocity to sides (left and right) the player moves normally however with a small speed applied down. Basically it's walking diagonally.

Code:
velocityByAngles(Float:vAngles[3], iAngleVector, Float:flSpeed, Float:vVelocity[3]) {     static Float:vVector[3];     angle_vector(vAngles, iAngleVector, vVector);     vVelocity[0] = flSpeed * vVector[0];     vVelocity[1] = flSpeed * vVector[1];     vVelocity[2] = flSpeed * vVector[2]; }


All times are GMT -4. The time now is 06:58.

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