Air/Ground Speed Boost
I want to make a speed boost that works both ground and air.
I want it to first get the current speed of the player, and then add a X amount to it (to look like it gets "boosted"). I dont wanna use Velocity by Aim, because like the title says, this needs to work while in Air (for example in Surf) Full example: If the player is going forward (but its not in the ground), with X current speed, when he shoots he gets +10 speed added to his current speed, whiout changing his direction, i mean, where he aims doesnt effect anything. I have tryied some methods. Right now this is what i have: PHP Code:
How can i fix it? Thank you. |
Re: Air/Ground Speed Boost
Use this to detect if is player surfing and set velocity :click here
Else if is not surfing then set maxspeed to player. |
Re: Air/Ground Speed Boost
Quote:
I have tried alot of methods, but none of them work the way i want. |
Re: Air/Ground Speed Boost
For example, when i use
PHP Code:
How can i fix that? |
Re: Air/Ground Speed Boost
Get user velocity, multiply it and then set it back, like this:
PHP Code:
Just play with z,x,y and try to modify values until you get perfect surfing boost. |
Re: Air/Ground Speed Boost
It's rather easy, just some simple vector math.
If you want to increase velocity magnitude (speed) by a relative amount (a percentage) in the current direction, you can just multiply it by a scalar value, i.e (you have to include xs.inc): PHP Code:
PHP Code:
|
Re: Air/Ground Speed Boost
Quote:
Code:
plugin from here : https://forums.alliedmods.net/showthread.php?t=61237 |
Re: Air/Ground Speed Boost
There's no reason to use xs.inc if the current code works properly, XS most likely won't give you any performance boost. Just keep it as it is.
|
Re: Air/Ground Speed Boost
Quote:
|
Re: Air/Ground Speed Boost
Quote:
:bee::bee: |
| All times are GMT -4. The time now is 09:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.