Skip to content

Ox.CreateVehicle plate issue #227

@newbialywhodis

Description

@newbialywhodis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions