To install MrNewbVehicleKeys to the core you will need use this snippet
Step #1 adding RemoveKeys for /dv, find the below in qb-core/client/events.lua
-- Find This in qb-core/client/events.lua aprox around line 144RegisterNetEvent('QBCore:Command:DeleteVehicle', function()local ped =PlayerPedId()local veh =GetVehiclePedIsUsing(ped)if veh ~=0thenSetEntityAsMissionEntity(veh, true, true)DeleteVehicle(veh)elselocal pcoords =GetEntityCoords(ped)local vehicles =GetGamePool('CVehicle')for _, v inpairs(vehicles) doif#(pcoords -GetEntityCoords(v)) <=5.0thenSetEntityAsMissionEntity(v, true, true)DeleteVehicle(v)endendendend)
Please note, if you are using an alternative admin menu that registers the command /car you will need to add my exports there as well. Default qb-vehiclekeys events should all work as of now.
-- Paste this in in its place
RegisterNetEvent('QBCore:Command:DeleteVehicle', function()
local ped = PlayerPedId()
local veh = GetVehiclePedIsUsing(ped)
if veh ~= 0 then
exports.MrNewbVehicleKeys:RemoveKeys(veh)
SetEntityAsMissionEntity(veh, true, true)
DeleteVehicle(veh)
else
local pcoords = GetEntityCoords(ped)
local vehicles = GetGamePool('CVehicle')
for _, v in pairs(vehicles) do
if #(pcoords - GetEntityCoords(v)) <= 5.0 then
exports.MrNewbVehicleKeys:RemoveKeys(v)
SetEntityAsMissionEntity(v, true, true)
DeleteVehicle(v)
end
end
end
end)
Step #2 Go to qb-core/shared/items.lua and paste this in, depending on the qb
version you use I have added both qbs old and new formats