editable.lua

editableFunctions                = {}

editableFunctions.UiOpened       = function()
    TriggerEvent("tgiann-hud:ui", false)
    TriggerEvent("tgiann-lumihud:ui", false)
end

editableFunctions.UiCloased      = function()
    TriggerEvent("tgiann-hud:ui", true)
    TriggerEvent("tgiann-lumihud:ui", true)
end

editableFunctions.TeleportPlayer = function(coords)
    SetEntityCoords(PlayerPedId(), coords.x, coords.y, coords.z)
end

--type: testdrive, shopSelectedVehicle, purchased, gizmo
editableFunctions.CarSpawned     = function(vehicle, carType)
    local plate = GetVehicleNumberPlateText(vehicle)
    if config.tgiannServer then
        TriggerEvent("x-hotwire:give-keys", vehicle)
    elseif config.vehicleKey.tgiann_hotwire then
        if carType == "purchased" then
            exports["tgiann-hotwire"]:GiveKeyVehicle(vehicle, true)
        end
    elseif carType ~= "gizmo" and carType ~= "shopSelectedVehicle" then
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
        TriggerEvent("x-hotwire:give-keys", vehicle)
        TriggerEvent('tgiann-hotwire:give-keys-with-carid', vehicle)
    end
end

editableFunctions.OpenBossMenu   = function(job)
    if config.tgiannServer then
        TriggerEvent('esx_society:openBossMenu', job, nil, { wash = false })
    else
        if config.framework == "esx" then
            TriggerEvent('esx_society:openBossMenu', job, nil, { wash = false })
        elseif config.framework == "qb" then
            TriggerEvent("qb-bossmenu:client:OpenMenu")
        end
    end
end

Last updated