Raised This Month: $ Target: $400
 0% 

[Orpheu] Player jump power


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-23-2012 , 10:14   [Orpheu] Player jump power
Reply With Quote #1

I want to add some power to user jump ( without changing gavity just velocity )

my code
Code:
OrpheuRegisterHook( OrpheuGetFunctionFromClass("player","Jump","CBasePlayer") , "playerJump" , OrpheuHookPost );
Code:
public playerJump( id ){
	
	new iFlags	=	pev( id , pev_flags );
	
	if( !( pev( id , pev_button ) & IN_JUMP ) || pev( id , pev_oldbuttons ) & IN_JUMP || iFlags & FL_WATERJUMP || pev( id , pev_waterlevel ) >= 2 || !( iFlags & FL_ONGROUND ) ){
		return ;
	}
	
	new Float: fVec[ 3 ];
		
	pev( id , pev_velocity , fVec ) ;
	
	client_print( 0 , 3 , "%f | %f | %f" , fVec[ 0 ] , fVec[ 1 ] , fVec[ 2 ] );
	
	fVec[ 2 ]	+=	floatmul( fVec[ 2 ] , fPercent  ) ;
	 
	set_pev( id , pev_velocity , fVec );
}
Code:
{
    "name" : "Jump",
    "class" : "CBasePlayer",
    "library" : "mod",
    "indexes" : 
    [
        {
            "os" : "linux",
            "mod" : "cstrike",
            "value" : 78
        }
    ]
}
fVec[ 2 ] is always 0.0 so this code don't work
I know I can calculate it from "sqrt( height * gravity * 2)" but I would want to write it without this
also I know it possible to do it with prethink/postthink but I think Orpheu is more effective
__________________

Last edited by DarkGL; 08-23-2012 at 10:19.
DarkGL is offline
 


Thread Tools
Display Modes

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 05:51.


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