Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ox.CreateVehicle plate issue #227

Open
newbialywhodis opened this issue Feb 2, 2025 · 0 comments
Open

Ox.CreateVehicle plate issue #227

newbialywhodis opened this issue Feb 2, 2025 · 0 comments

Comments

@newbialywhodis
Copy link

Hi,
For a long time, there has been an issue with setting the vehicle's license plate when using Ox.CreateVehicle.

Using the following code:

    CreateThread(function()
        local vehicle = Ox.CreateVehicle({
            model = vehicleData.vehicleName,
            owner = OxPlayer.charId,
            properties = {
                color1 = { r, g, b }
            }
        }, freeSpawnPoint.xyz, freeSpawnPoint.w)

        Wait(500)
        exports.ox_inventory:AddItem(source, 'carkeys', 1, {plate = vehicle.plate})
        lib.print.info(vehicle.entity)
        TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle.entity, -1)
        lib.print.info(GetVehicleNumberPlateText(vehicle.entity))
    end)

From time to time, instead of getting prints like:

[INFO] 132873  
[INFO] IOI3M7F7  

we get:

[INFO] 132873  
[INFO]  

As a result, the vehicle is created with the wrong license plate, such as '202196', even though the correct plate 'IOI3M7F7' is stored in the database.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant