Welcome to the forum, Guest

To access forum content and all of our services, you must register or log in to the forum. Joining the forum and all content on the forum is completely free.

CR WORLD: https://discord.gg/9tB6FAMJVp

The world's largest FiveM Forum and GTA 5 Forum address
Hello dear member
We work 24/7 to provide the most valuable content that will be of use to you,
you can share content and support the entire FiveM & GTA 5 mods.

? MojiaVehicleKeys

CR LEAKS

FOUNDER


Please, Log in or Register to view URLs content!

Dependencies:​

Features:​

  • The vehicle key will now act as an item
  • Additional vehicle keys can be purchased at an adjustable price to give to friends (default 10% of vehicle value)
  • When you sell your vehicle to someone else, all the keys to the vehicle that were not created by the new owner will be deleted

Installation:​

qb-vehicleshop:​

  • Edit qb-vehicleshop\client.lua:
RegisterNetEvent('qb-vehicleshop:client:buyShowroomVehicle', function(vehicle, plate)
QBCore.Functions.SpawnVehicle(vehicle, function(veh)
TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1)
exports['LegacyFuel']:SetFuel(veh, 100)
SetVehicleNumberPlateText(veh, plate)
SetEntityHeading(veh, Config.Shops[getShopInsideOf()]["VehicleSpawn"].w)
SetEntityAsMissionEntity(veh, true, true)
TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(veh))
TriggerServerEvent('MojiaVehicleKeys:server:AddVehicleKey', QBCore.Functions.GetPlate(veh), vehicle)
TriggerServerEvent("qb-vehicletuning:server:SaveVehicleProps", QBCore.Functions.GetVehicleProperties(veh))
end, Config.Shops[getShopInsideOf()]["VehicleSpawn"], true)
end)

qb-inventory:​

Add item info to qb-inventory\html\js\app.js

} else if (itemData.name == "vehiclekey") {
$(".item-info-title").html(
'<p>' + itemData.info.vehname + '</p>'
);
$(".item-info-description").html(
'<p>Owner : ' + itemData.info.owner +
'</p><p>Plate: ' + itemData.info.plate +
'</p>'
);
}
Add img to qb-inventory\html\images with name carkeys.png:

Please, Log in or Register to view URLs content!


qb-core:​

Add to qb-core\shared\items.lua:

['vehiclekey'] = {
['name'] = 'vehiclekey',
['label'] = 'Vehicle Key',
['weight'] = 0,
['type'] = 'item',
['image'] = 'carkeys.png',
['unique'] = true,
['useable'] = false,
['shouldClose'] = false,
['combinable'] = nil,
['description'] = 'This is a car key, take good care of it, if you lose it you probably won\'t be able to use your car'
},

qb-hud:​

  • Change qb-hud\client.lua
RegisterCommand('+engine', function()
TriggerEvent('MojiaVehicleKeys:client:Engine')
end)
do the same thing with Lock/Unlock event

TriggerEvent('MojiaVehicleKeys:client:lockVehicle')

Event:​

  • Check vehicles key:
if exports['MojiaVehicleKeys']:CheckHasKey(plate) then
  • Lock/Unlock Vehicles:
'MojiaVehicleKeys:client:lockVehicle'
  • On/Off Engine:
'MojiaVehicleKeys:client:Engine'
  • Add new key:
TriggerServerEvent('MojiaVehicleKeys:server:AddVehicleKey', plate, model)
  • Change owner:
TriggerClientEvent('MojiaVehicleKeys:client:AddVehicleKey',target, plate, model)
 

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Register

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Register now
Log in

Eğer bir hesabınız var ise lütfen giriş yapın

Log in

Tema düzenleyici

Tema özelletirmeleri

Grafik arka planlar

Granit arka planlar