Raised This Month: $ Target: $400
 0% 

Solved Get direction player is moving relative to other player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Effeff
AlliedModders Donor
Join Date: Jan 2019
Location: discord: ff#0533
Old 03-01-2021 , 19:32   Re: Get direction player is moving relative to other player
Reply With Quote #3

Thanks for your advice.

I currently have this, but I am getting a number in the thousands.

PHP Code:
float GetDamageVelocityModifier(int attackerint victim)
{
    
float attackerPos[3], victimPos[3], unitVec[3], attackerVel[3], attackerNextPos[3], attackerVelVec[3];

    
GetClientAbsOrigin(attackerattackerPos);
    
GetClientAbsOrigin(victimvictimPos);
    
MakeVectorFromPoints(attackerPosvictimPosunitVec);

    
GetEntPropVector(attackerProp_Data"m_vecVelocity"attackerVel);
    
AddVectors(attackerPosattackerVelattackerNextPos);
    
MakeVectorFromPoints(attackerPosattackerNextPosattackerVelVec);

    return 
0.5 GetVectorDotProduct(unitVecattackerVelVec);

I am guessing what I forgot to do is use NormalizeVector somewhere?
Effeff is offline
 



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:38.


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