Harness + Seatbelt

Installation

The script can take control of the already in place harness item

This can be enabled or disabled in the config with Config.Harness.HarnessControl == true

If you enable this, there are a few steps you need to take as this is handled in jim-mechanic.

  1. Delete the file seatbelt.lua from qb-smallresources > client

  2. REMOVE these 3 events from qb-smallresources > server > main.lua:

QBCore.Functions.CreateUseableItem('harness', function(source, item)
    TriggerClientEvent('seatbelt:client:UseHarness', source, item)
end)

RegisterNetEvent('equip:harness', function(item)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end
    if not Player.PlayerData.items[item.slot].info.uses then
        Player.PlayerData.items[item.slot].info.uses = Config.HarnessUses - 1
        Player.Functions.SetInventory(Player.PlayerData.items)
    elseif Player.PlayerData.items[item.slot].info.uses == 1 then
        exports['qb-inventory']:RemoveItem(src, 'harness', 1, false, 'equip:harness')
        TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['harness'], 'remove')
    else
        Player.PlayerData.items[item.slot].info.uses -= 1
        Player.Functions.SetInventory(Player.PlayerData.items)
    end
end)

RegisterNetEvent('seatbelt:DoHarnessDamage', function(hp, data)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end
    if hp == 0 then
        exports['qb-inventory']:RemoveItem(src, 'harness', 1, data.slot, 'seatbelt:DoHarnessDamage')
    else
        Player.PlayerData.items[data.slot].info.uses -= 1
        Player.Functions.SetInventory(Player.PlayerData.items)
    end
end)

To make your hud not complain about the harness export you will need to change the name of the export to `jim-mechanic`

PS-HUD

ps-hud > client.lua > line 80 REPLACE:

WITH:

QB-HUD

REPLACE:

WITH:

To hide the speedometer you will need to remove these html lines: [qb] > qb-hud > html > index.html remove:

QB-RADIAL

Search for:

and replace with:


Configuration

The configuration is handled by the file modifiers_conf.lua


Last updated