alt.Vehicle.getByID
Used to get
a vehicle by a server-side ID.
Returns a alt.Vehicle
.
Declaration
alt.Vehicle.getByID(value: number): alt.Vehicle | null
Usage
const vehicle = alt.Vehicle.getByID(1);
Real World Example
Randomizes all vehicle colors on the server.
const vehicle = alt.Vehicle.getByID(1);
if (vehicle) {
console.log(`Vehicle Exists on client-side!`);
}
These examples assume you have vehicle created or available on client-side