Notice: Failed to invoke Pygments: [Called from MediaWiki\SyntaxHighlight\SyntaxHighlight::highlightInner in /home/pi/www/gtac/wiki/wiki/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php at line 334] in /home/pi/www/gtac/wiki/wiki/includes/debug/MWDebug.php on line 507
Player Jump Commands - GTA Connected

Player Jump Commands

Description

This code increases the player's Z velocity when /jump is typed, or increases the Z position when /jump2 is typed.

Code

Lua, Client-Side, GTAC versions 1.0.72 and newer:

addCommandHandler('jump', function(cmd,args)
	local value = tonumber(args) or 5
	local v = localPlayer.velocity
	localPlayer.velocity = {v.x,v.y,v.z+value}
end)

addCommandHandler('jump2', function(cmd,args)
	local value = tonumber(args) or 5
	local p = localPlayer.position
	localPlayer.position = {p.x,p.y,p.z+value}
end)