Open DrDeath25 opened 4 months ago
Edit it like this:
local TargetResource = Config.TargetResource
if TargetResource == 'ox_target' then
exports.ox_target:addModel('electric_charger', {
{
name = "grab_electric_nozzle",
event = "cdn-fuel:client:grabelectricnozzle",
icon = "fas fa-bolt",
label = Lang:t("grab_electric_nozzle"),
canInteract = function(entity, distance, data)
if not IsHoldingElectricNozzle() and not IsPedInAnyVehicle(PlayerPedId()) then
return true
end
end
},
{
name = "return_nozzle",
event = "cdn-fuel:client:returnnozzle",
icon = "fas fa-hand",
label = Lang:t("return_nozzle"),
canInteract = function(entity, distance, data)
if IsHoldingElectricNozzle() and not refueling then
return true
end
end
}
})
else
exports['qb-target']:AddTargetModel('electric_charger', {
options = {
{
num = 1,
type = "client",
event = "cdn-fuel:client:grabelectricnozzle",
icon = "fas fa-bolt",
label = Lang:t("grab_electric_nozzle"),
canInteract = function()
if not IsHoldingElectricNozzle() and not IsPedInAnyVehicle(PlayerPedId()) then
return true
end
end
},
{
num = 2,
type = "client",
event = "cdn-fuel:client:returnnozzle",
icon = "fas fa-hand",
label = Lang:t("return_nozzle"),
canInteract = function()
if IsHoldingElectricNozzle() and not refueling then
return true
end
end
},
},
distance = 2.0
})
end
end
Im using ox_target and i cant interact with electric charger
Steps to reproduce the behavior:
Expected behavior Open context menu after interacting with electric charger prop with ox_target