Skip to content

[BUG] CreateVehicle does not save to database when no coords have been passed. #208

@andreutu

Description

@andreutu

Slight issue spotted in ox_core: a lot of people specified that using CreateVehicle without coords will just upload it to the database as long as it has an owner. Well, below you can find an example of an usage of this function, which does not upload it to the database:

await CreateVehicle(
	{
		model: "blista",
		owner: 1,
		stored: "pdm",
	}
);

NOTE: the values are mostly imaginary, main idea is they aren't the problem.
I have to guess that this is not intentional. This comes from the fact that ox_core first checks whether the entity exists (in this case it does not, since no coords have been passed).

if (!entity || !DoesEntityExist(entity)) return;

This is executed before saving to database. The full problematic code can be found here. I suggest maybe fixing this soon, as it can be a critical bug for some people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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