alt.Vehicle.getByScriptID

Used to get a vehicle by a client-side script identifier for natives.

Returns a alt.Vehicle.

Declaration

alt.Vehicle.getByScriptID(scriptID: number): alt.Vehicle | null

Usage

const vehicle = alt.Vehicle.getByScriptID(1);

Real World Example

Randomizes all vehicle colors on the server.

const vehicle = alt.Vehicle.getByScriptID(1);

if (vehicle) {
    console.log(`Vehicle Exists on client-side!`);
}

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

results matching ""

    No results matching ""