Set how far players can jump

Hi all,

I’m making a gamemode which derives from sandbox and I can’t figure one thing. How can I set how far the player can jump. Since when they sprint and jump they go about 10m forward.

Thanks,
Computer600

It’s dependant on the speed of the player and the power of their jump, try messing with a combination of these:
SetJumpPower
SetRunSpeed
SetWalkSpeed

Where are those located?

Hmm, I’ve tried countless attempts at those with no luck.

In a GAMEMODE function, I know they are defiantly running because I have printer the speeds and jump power

Edit: if it helps I’m trying to get the same type of movement as darkrp

*definitely

Set them in PlayerSpawn.

I modified mine:


	hook.Call( "SetPlayerSpeed", GAMEMODE, _p, {
		walk_speed = PLAYER_WALK_SPEED;
		run_speed = PLAYER_RUN_SPEED;
		jump_power = PLAYER_JUMP_POWER;
		crouched_walk_speed = PLAYER_CROUCHED_WALK_SPEED;
		duck_speed = PLAYER_DUCK_SPEED;
		unduck_speed = PLAYER_UNDUCK_SPEED;
	} );

And how I have it:


//
// Modified SetPlayerSpeed to allow different options, and access to all speeds - Josh 'Acecool' Moser
//
function GM:SetPlayerSpeed( _p, _options )
	// How powerful our jump should be
	if ( _options.jump_power ) then
		_p:SetJumpPower( _options.jump_power );
	end

	// How fast to move when not running
	if ( _options.walk_speed ) then
		_p:SetWalkSpeed( _options.walk_speed );
	end

	// How fast to move when running
	if ( _options.run_speed ) then
		_p:SetRunSpeed( _options.run_speed );
	end

	// Multiply move speed by this when crouching
	if ( _options.crouched_walk_speed ) then
		_p:SetCrouchedWalkSpeed( _options.crouched_walk_speed );
	end

	// How fast to go from not ducking, to ducking
	if ( _options.duck_speed ) then
		_p:SetDuckSpeed( _options.duck_speed );
	end

	// How fast to go from not ducking, to ducking
	if ( _options.unduck_speed ) then
		_p:SetUnDuckSpeed( _options.unduck_speed );
	end
end

I’m guessing you want something like a “power” jump?
Speed’s Fast -> Player Jumps = Far Jump
Speed’s Slow -> Player Jumps = Short Jump

Correct me if I’m wrong.

Playing in singleplayer makes you jump forward faster than multiplayer.