Fixed code
-- SERVER SIDE
function jumpWithVehicle(playerWhoPressedTheButton)
if not isPedInVehicle(playerWhoPressedTheButton) then return end -- kill function if player is not in vehicle
local vehicleElement = getPedOccupiedVehicle(playerWhoPressedTheButton) -- we know player is in a vehicle, so get the vehicle's element
if getVehicleController(vehicleElement) ~= playerWhoPressedTheButton then return end -- check player is who drive this vehicle (if not -> kill function)
local playerAccountName = getAccountName(getPlayerAccount(playerWhoPressedTheButton)) -- get the player's account name
if isObjectInACLGroup("user."..playerAccountName, aclGetGroup("Admin")) then -- check is player in the 'Admin' ACL group.
local vehicleType = getVehicleType(vehicleElement)
if vehicleType == "Plane" or vehicleType == "Helicopter" then return end -- kill function if the vehicle is a Plane/Helicopter
local velocity_x, velocity_y, velocity_z = getElementVelocity(vehicleElement)
setElementVelocity(vehicleElement, velocity_x, velocity_y, velocity_z + 0.33) -- boost vehicle's Z velocity
end
end
addEventHandler("onResourceStart", resourceRoot, function()
for _, onlinePlayer in ipairs(getElementsByType("player")) do
bindKey(onlinePlayer, "lshift", "down", jumpWithVehicle)
end
end)
addEventHandler("onPlayerJoin", root, function()
bindKey(source, "lshift", "down", jumpWithVehicle)
end)