Raised This Month: $ Target: $400
 0% 

Air/Ground Speed Boost


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-05-2016 , 23:31   Air/Ground Speed Boost
Reply With Quote #1

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:
public forward_PreThink(id)
{
    if(
pev(idpev_button) & IN_ATTACK)
    {    
        new 
Float:CurrentVelocity[3], Float:FinalVelocity[3]
        
pev(idpev_velocityCurrentVelocity)

        
FinalVelocity[2] = CurrentVelocity[2] + 10
        
        set_pev
(idpev_velocityFinalVelocity)
    }

And ofc it doesnt work correctly.

How can i fix it? Thank you.

Last edited by Syturi0; 01-05-2016 at 23:36.
Syturi0 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 09:27.


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