Client/migrate.lua

local function onceSetKeyInIgnition(bool, vehicle, plate)
    local netId = vehicle and NetworkGetNetworkIdFromEntity(vehicle) or nil
    TriggerServerEvent("tgiann-hotwire:server:OnceSetKeyInIgnition", bool, netId, plate)
end
exports("OnceSetKeyInIgnition", onceSetKeyInIgnition)

RegisterNetEvent('vehiclekeys:client:SetOwner')
AddEventHandler('vehiclekeys:client:SetOwner', function(plate)
    onceSetKeyInIgnition(true, nil, plate)
end)

--Some users use a different hotwire that's for it
RegisterNetEvent('x-hotwire:give-keys')
AddEventHandler('x-hotwire:give-keys', function(vehicle)
    onceSetKeyInIgnition(true, vehicle)
end)

--qb-smallresources/server/consumables.lua use lockpick item (lockpick)
if config.outSideLockpick.useQbSmallResources then
    RegisterNetEvent('lockpicks:UseLockpick')
    AddEventHandler('lockpicks:UseLockpick', function(isAdv)
        if isAdv then return end
        TriggerEvent("tgiann-hotwire:client:lockpickOutSide")
    end)
end

Last updated