AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ways to enlarge the maximum jump velocity of the player? (https://forums.alliedmods.net/showthread.php?t=340850)

AnimalMonster 12-14-2022 11:07

Ways to enlarge the maximum jump velocity of the player?
 
Does anyone know an effective and simple way to enlarge maximum jump velocity of the player, on any engine (ReHLDS, HLDS)?

JocAnis 12-14-2022 12:01

Re: Ways to enlarge the maximum jump velocity of the player?
 
change his vel[ 2 ] ?

Code:

public client_PreThink( id )
{
    if( !is_user_alive( id ) )
        return PLUGIN_CONTINUE

    if( pev( id, pev_flags ) & FL_ONGROUND && pev( id, pev_button ) & IN_JUMP )
    {
        new Float: vel[ 3 ]
        pev( id, pev_velocity, vel )
        vel[ 2 ] += 300.0
        set_pev( id, pev_velocity, vel )
    }
}


MrPickles 12-14-2022 19:00

Re: Ways to enlarge the maximum jump velocity of the player?
 
Quote:

Originally Posted by JocAnis (Post 2795190)
change his vel[ 2 ] ?

Code:

public client_PreThink( id )
{
    if( !is_user_alive( id ) )
        return PLUGIN_CONTINUE

    if( pev( id, pev_flags ) & FL_ONGROUND && pev( id, pev_button ) & IN_JUMP )
    {
        new Float: vel[ 3 ]
        pev( id, pev_velocity, vel )
        vel[ 2 ] += 300.0
        set_pev( id, pev_velocity, vel )
    }
}



RegisterHam( Ham_Player_Jump, "player", "Ham_PlayerBlock" )

better use Ham Jump instead of client_prethink

AnimalMonster 12-15-2022 03:53

Re: Ways to enlarge the maximum jump velocity of the player?
 
I always thought that those wouldn't work correctly since when the pksyer jumps the velocity slowly gets to the max height when jumping.

AnimalMonster 12-20-2022 11:18

Re: Ways to enlarge the maximum jump velocity of the player?
 
How about this?
https://github.com/s1lentq/ReGameDLL...ared.cpp#L2345
Recently found this and looks like what i've been searching for! I can just check if the player is in water to let it cover that part.


All times are GMT -4. The time now is 15:33.

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