Target

These functions are available in the file config/shared.lua

QB-Target

function target(elements, event, label)
    exports['qb-target']:AddTargetModel(elements, {
        options = {{
            type = "client",
            event = event,
            icon = "fas fa-box-circle-check",
            label = label
        }},
        distance = 3.0
    })
end

function entityTarget(entity, event, label)
    exports['qb-target']:AddTargetEntity(entity, {
        options = {{
            type = "client",
            event = event,
            icon = "fas fa-box-circle-check",
            label = label
        }},
        distance = 3.0
    })
end

function removeTarget(element)
    exports['qb-target']:RemoveTargetModel(element)
end

OX-Target

function target(elements, event, label)
    local options = {
        event = event,
        icon = "fas fa-box-circle-check",
        label = label
    }
    exports.ox_target:addModel(elements, options)
end


function entityTarget(entity, event, label)
    NetworkRegisterEntityAsNetworked(entity)
    local netId = NetworkGetNetworkIdFromEntity(entity)
    local options = {
        event = event,
        icon = "fas fa-box-circle-check",
        label = label
    }
    exports.ox_target:addEntity(netId, options)
end


function removeTarget(element)
    exports.ox_target:removeModel(element, nil)
end

Last updated