Features
- Key as item with plate of vehicle in description
- By using item you can lock/unlock your vehicle
- Starting vehicle with keys automatically
- Engine stays on if you don’t turn it off (command /engine or by locking your vehicle from outside)
- Open or start vehicle with lockpick
- Event for removing keys (for ex. after storing job vehicles)
- Added file with description how to implement it to your garage script and jobs
- Buy new keys to any vehicle you own, you can set unlimited places
- Edit chances of police calls, lockpick, alarm, locations, key price etc. in config file
- Vehicle Stealing from NPCs – aim your gun on driving NPC, wait for his decision or kill him and take the keys by entering the vehicle
Craig Smith (verified owner) –
i dont know how to add this to my garage script so the keys disappear when the vehicle is despawned
if IsControlJustPressed(0, 38) and not Pressed then — after pressing E with variable Pressed = false
Pressed = true — just for spamming protection
local curVeh = GetVehiclePedIsIn(ped) — gets players vehicle
local plate, varplate = GetVehicleNumberPlateText(curVeh), GetVehicleNumberPlateText(curVeh) — gets plate of vehicle and also gets plate of vehicle again just in different variable
QBCore.Functions.TriggerCallback(‘qb-garage:server:checkVehicleOwner’, function(owned) — callback for checking ownership
if owned then
QBCore.Functions.TriggerCallback(‘qb-vehiclekeys:HasKeys’, function(varplate) — has keys
if varplate then — got keys with correct plate
local bodyDamage = math.ceil(GetVehicleBodyHealth(curVeh))
local engineDamage = math.ceil(GetVehicleEngineHealth(curVeh))
local totalFuel = exports[‘LegacyFuel’]:GetFuel(curVeh)
CurrentVehicleData = QBCore.Functions.GetVehicleProperties(curVeh)
TriggerServerEvent(‘qb-customs:server:SaveVehicleProps’, CurrentVehicleData)
TriggerServerEvent(‘qb-garage:server:updateVehicleStatus’, totalFuel, engineDamage, bodyDamage, plate, k)
TriggerServerEvent(‘qb-garage:server:updateVehicleState’, 1, plate, k)
TriggerServerEvent(‘vehiclemod:server:saveStatus’, plate)
QBCore.Functions.Notify(“You stored the vehicle into “.. Garages[k].label ..” and handed over the vehicle keys.”, “success”, 7000)
TriggerServerEvent(‘qb-removekeys’, plate) — removing keys before storing vehicle
CheckPlayers(curVeh)
Wait(500)
QBCore.Functions.DeleteVehicle(curVeh)
if plate ~= nil then
OutsideVehicles[plate] = veh
TriggerServerEvent(‘qb-garages:server:UpdateOutsideVehicles’, OutsideVehicles)
end
else
QBCore.Functions.Notify(“You don’t have vehicle keys of this vehicle.”, “primary”, 4500)
end
end, varplate)
else
QBCore.Functions.Notify(“You don’t own this vehicle..”, “error”, 3500)
end
Pressed = false — protection off
end, plate)
end
davidbrsak (verified owner) –
Having also issues with putting the code in the garage script. Could we get some help somehow? i mean we payed for the script i hope the seller answers
kane –
where do i put the garage stuff client or server