SOH69 / mm_carkeys

A vehiclekeys/carkeys management script for QBCore, ESX, QBox
GNU General Public License v3.0
30 stars 11 forks source link

Question about exports #1

Closed Royale06 closed 10 months ago

Royale06 commented 10 months ago

Hello, i wanted to implement the script into a modified esx_vehicleshop with exports and it seems to be not giving me the right key with the car. The plate is correct and the model on the key too but every time i buy a car the key is not working with it. Im using esx with the ox scripts.

Thank you for helping me out.

`RegisterNetEvent('villamos_vehshop:spawnCar', function(coords, model, plate)

local hash = GetHashKey(model)
if not IsModelInCdimage(hash) then 
    return print("^1SCRIPT ERROR: Invalid model: "..model)
end 
while not HasModelLoaded(hash) do 
    RequestModel(hash)
    Wait(10)
end 
local vehicle = CreateVehicle(hash, coords, true, true)
SetVehicleNumberPlateText(vehicle, plate)
TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1)
SetModelAsNoLongerNeeded(hash)
exports.mm_carkeys:GiveKeyItem(plate, vehicle)

end)`

SOH69 commented 10 months ago

This seems to work fine, get the latest version maybe and report me need to take a look with ox inventory

Royale06 commented 10 months ago

I'm using the latest version and the problem is still up. It adds the key into my inventory with the correct data but the carkey is not working with the export. I can provide video if you'd like

SOH69 commented 10 months ago

can you provide me the video with any f8 console error on client/server side

Royale06 commented 10 months ago

I made a video about buying the car and the aftermath of it. The same problem appears, all data are good but when i try starting it with W or /engine there's nothing. The item is called "Kocsikulcs" and its the 3rd row 1st item in the inventory. You can watch the video on medal by clicking here.

SOH69 commented 10 months ago

New ESX fix branch Release

Royale06 commented 10 months ago

Thank you, i will try it and let you know.

Royale06 commented 10 months ago

So i tested it and now it works perfectly fine, right key, right car. Thank you for helping me out.