- Katılım
- 1 yıl 1 ay 11 gün
- Mesajlar
- 131
- Discord
- sentinus1996
Linkleri,görmek için
Giriş yap veya üye ol.
Buradaki scripti kurdumSırasıyla doğru yaptım sanıyorum
qb-core shared/items.lua
Kod:
-- Vehicle Keys
vehiclekey = {name = 'vehiclekey', label = 'Vehicle key', weight = 0, type = 'item', image = 'vehiclekeys.png', unique = true, useable = true, shouldClose = true, 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-inventory/html/js/app.js
Kod:
function FormatItemInfo(itemData) {
if (itemData && itemData.info !== "") {
const description = generateDescription(itemData);
setItemInfo(itemData.label, description);
} else if (itemData.name == "vehiclekey") {
$(".item-info-title").html('<p>' + itemData.info.model + '</p>');
$(".item-info-description").html('<p>Plate : ' + itemData.info.plate + '</p>');
}
}
qb-vehicleshop/client/client.lua
Kod:
RegisterNetEvent('qb-vehicleshop:client:spawnVehicle', function(model, plate)
local hash = GetHashKey(model)
QBCore.Functions.TriggerCallback('QBCore:Server:SpawnVehicle', function(netId)
local veh = NetToVeh(netId)
exports['LegacyFuel']:SetFuel(veh, 100)
SetVehicleNumberPlateText(veh, plate)
SetEntityHeading(veh, spawn)
--TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(veh))
SetVehicleModKit(veh, 0)
SetVehicleCustomPrimaryColour(veh, math.ceil(rgbColorSelected[1]), math.ceil(rgbColorSelected[2]), math.ceil(rgbColorSelected[3]))
SetVehicleCustomSecondaryColour(veh, math.ceil(rgbSecondaryColorSelected[1]), math.ceil(rgbSecondaryColorSelected[2]), math.ceil(rgbSecondaryColorSelected[3]))
TriggerServerEvent("qb-vehicletuning:server:SaveVehicleProps", QBCore.Functions.GetVehicleProperties(veh))
TriggerServerEvent('new-vehiclekeys:server:BuyVehicle', plate, GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(veh)))) --Change Add
end, model, spawn, true)
end)
qb-garages/client/main.lua
Kod:
RegisterNetEvent('qb-garages:client:takeOutGarage', function(data)
QBCore.Functions.TriggerCallback('qb-garages:server:IsSpawnOk', function(spawn)
if spawn then
local location = GetSpawnPoint(data.garage)
if not location then return end
QBCore.Functions.TriggerCallback('qb-garages:server:spawnvehicle', function(netId, properties, vehPlate)
while not NetworkDoesNetworkIdExist(netId) do Wait(10) end
local veh = NetworkGetEntityFromNetworkId(netId)
Citizen.Await(CheckPlate(veh, vehPlate))
QBCore.Functions.SetVehicleProperties(veh, properties)
exports[Config.FuelResource]:SetFuel(veh, data.vehicle.fuel)
TriggerServerEvent('qb-garages:server:updateVehicleState', 0, vehPlate)
--('vehiclekeys:client:SetOwner', vehPlate)
TriggerServerEvent('new-vehiclekeys:server:RemoveKey', plate)
if Config.Warp then TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1) end
if Config.VisuallyDamageCars then doCarDamage(veh, data.stats, properties) end
SetVehicleEngineOn(veh, true, true, false)
end, data.plate, data.vehicle, location, true)
else
QBCore.Functions.Notify(Lang:t('error.not_depot'), 'error', 5000)
end
end, data.plate, data.type)
end)
Nerede yanlış yaptım
Adamdan araba satın alınca anahtar direk envantere vb gelmiyor
NEWQBCORE kullanıyorum