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
__________________