Raised This Month: $ Target: $400
 0% 

Jump direction problem , going elsewhere =/


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 04-03-2009 , 10:40   Re: Jump direction problem , going elsewhere =/
Reply With Quote #7

first of all look at dores code to know how FM_CmdStart works (get_uc and not pev). you just changed your forwards name although you were still using FM_PlayerPreThink.

UC_Buttons & IN_JUMP or pev_button & IN_JUMP will be true for more than a single frame which means you will accelerate the player faster than you want him to be. for this you can easily use !( pev_oldbuttons & IN_JUMP ).

example:
1st frame - you jump - pev_button & IN_JUMP && !( pev_oldbuttons & IN_JUMP ) - you are in air
2nd frame - your in air and still pressing +jump - pev_button & IN_JUMP && pev_oldbuttons & IN_JUMP
3rd frame - you release jump - !( pev_button & IN_JUMP ) && pev_oldbuttons & IN_JUMP
4th frame - still in air - !( pev_button & IN_JUMP ) && !( pev_oldbuttons & IN_JUMP )
...
~70th frame - you land - !( pev_button & IN_JUMP ) && !( pev_oldbuttons & IN_JUMP )
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
 



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 02:19.


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