local sw, sh = guiGetScreenSize()
local jumpTimer = 0
local reload = 3000
function jump()
if getTickCount() - jumpTimer > reload then
local vehicle = getPedOccupiedVehicle(localPlayer)
if(vehicle)then
local sx, sy, sz = getElementVelocity(vehicle)
setElementVelocity(vehicle, sx, sy, sz+0.33)
end
jumpTimer = getTickCount()
end
end
addEventHandler("onClientRender", root,
function()
local now = getTickCount()
local endTime = jumpTimer + reload
local elapsedTime = now - jumpTimer
local duration = endTime - jumpTimer
local progress = elapsedTime / duration
local width = interpolateBetween(0, 0, 0, 200, 0, 0, progress, "Linear")
dxDrawRectangle(sw/2 - 100, sh - 100, 200, 20, tocolor(0, 0, 0, 180))
dxDrawRectangle(sw/2 - 100, sh - 100, width, 20, tocolor(0, 255, 0, 180))
end)
bindKey("lshift", "down", jump)