Player Jump Commands

From GTA Connected
Jump to navigation Jump to search

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)