Raised This Month: $ Target: $400
 0% 

Solved Knockback Wrong Calculation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 12-25-2020 , 17:51   Knockback Wrong Calculation
Reply With Quote #1

Hey, i try to make the zombie bomb from cso based on player's velocity and user's fistance from the explosion but the knockback power to be 100.0 + player's velocity based on the distance of the player from the bomb, longer distance = less knockback.

But.. didn't work as expected, i know it 100% is wrong but yeah.

PHP Code:
fl_Velocity[0] = (speed VicVelocity[0]) * ((EntOrigin[0] - VicOrigin[0]) / fl_Time)
fl_Velocity[1] = (speed VicVelocity[1]) * ((EntOrigin[1] - VicOrigin[1]) / fl_Time)
fl_Velocity[2] = (speed VicVelocity[2]) * ((EntOrigin[2] - VicOrigin[2]) / fl_Time)

fl_Time get_distance_f(EntOriginVicOrigin) / speed 
Edit: nevermind, i got it working the way i wanted eliminating the VicVelocity but
I put the speed as first thing multiplied by entorigin - vicorigin * fl_Time everything / 2

Last edited by AnimalMonster; 12-25-2020 at 18:22.
AnimalMonster 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 14:08.


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