qbcore-framework / qb-radialmenu

Radial Menu Used With QB-Core :arrows_counterclockwise:
GNU General Public License v3.0
32 stars 256 forks source link

Vehicle Extras #45

Closed bgibson6828 closed 2 years ago

bgibson6828 commented 3 years ago

When placing a vehicle extra onto a car you have to /fix the vehicle for the extras to show up onto the car

Bycarbon commented 3 years ago

This is a issue with the Radial Menu to apply the vehicle. When using a external ExtraMenu BEFORE using Radial, it works as intended.

Johnsmodifications commented 2 years ago

Having a similar issue, mine doesn't show up at all.

xCoryux commented 2 years ago

The error keeps popping up. If you change the code for the previous one, it works fine.

RegisterNetEvent('qb-radialmenu:client:setExtra') AddEventHandler('qb-radialmenu:client:setExtra', function(data) local string = data.id local replace = string:gsub("extra", "") local extra = tonumber(replace) local ped = PlayerPedId() local veh = GetVehiclePedIsIn(ped) local enginehealth = 1000.0 local bodydamage = 1000.0

if veh ~= nil then
    local plate = GetVehicleNumberPlateText(closestVehicle)

    if GetPedInVehicleSeat(veh, -1) == PlayerPedId() then
        if DoesExtraExist(veh, extra) then 
            if IsVehicleExtraTurnedOn(veh, extra) then
                enginehealth = GetVehicleEngineHealth(veh)
                bodydamage = GetVehicleBodyHealth(veh)
                SetVehicleExtra(veh, extra, 1)
                SetVehicleEngineHealth(veh, enginehealth)
                SetVehicleBodyHealth(veh, bodydamage)
                QBCore.Functions.Notify('Extra ' .. extra .. ' Desactivado', 'error', 2500)
            else
                enginehealth = GetVehicleEngineHealth(veh)
                bodydamage = GetVehicleBodyHealth(veh)
                SetVehicleExtra(veh, extra, 0)
                SetVehicleEngineHealth(veh, enginehealth)
                SetVehicleBodyHealth(veh, bodydamage)
                QBCore.Functions.Notify('Extra ' .. extra .. ' Activado', 'success', 2500)
            end
        else
            QBCore.Functions.Notify('Extra ' .. extra .. ' no está presente en este vehículo ', 'error', 2500)
        end
    else
        QBCore.Functions.Notify('¡No eres conductor de un vehículo!', 'error', 2500)
    end
end

end)

BerkieBb commented 2 years ago

Does anyone have a specific vehicle and extra they tried that I can test it with?

Bycarbon commented 2 years ago

Does anyone have a specific vehicle and extra they tried that I can test it with?

I know for certain it was doing it on the OCRP Law Enforcement Pack 110%, but I didnt use many other modded vehicles at the time.

BerkieBb commented 2 years ago

I don't have any addon cars, test some gta cars

BerkieBb commented 2 years ago

They work fine for me

BlueSky-fur commented 2 years ago

it seems to only be an issue with addon vehicles.

wouldnt it be smarter to just add Vehicle Extras to choose at bennys so that they also get actually saved into the DB?

BerkieBb commented 2 years ago

No, if it's an issue with addon vehicles, it means that something is wrong in either the carcols or carvariations meta files

Ghavio1516 commented 1 year ago

do you guys have any fix yet? i still need to /fix the vehicle for the extras to show up onto the car

promiiss033 commented 3 weeks ago

I got this bug aswell with this truck. https://lunardev.co.uk/products/benefactor-recovery-truck

The ramps are extras 5 but i can only use it 1 time to show or hide, doing it again wont show nor remove again