getMeta

Used to store cross-resource accessible information. This functionality stores an object on a vehicle that can than be set with setMeta

This type of meta is only accessible where it is created.

If it is created on the client-side it is only accessible on the client-side.

If it's created on the server-side it is only accessible on the server-side.

Declaration

vehicle.getMeta(key: string): unknown;

Usage

const result = vehicle.getMeta('myData');

Real World Example

const result = alt.Player.local.vehicle.getMeta('myData');

// Data does not exist.
if (!result) {
    return;
}

console.log(result);

These examples assume you have vehicle created or available on client-side

results matching ""

    No results matching ""