- Documentation
- Shared functions
- getVehicleType
Function
getVehicleType
Returns the kind of vehicle (English name): Automobile, Bike, BMX, Quad, Monster Truck, Boat, Helicopter, Plane, Train, Trailer. Accepts a vehicle or a model number.
Syntax
string getVehicleType(vehicle/int vehicleOrModel)Arguments
vehicleOrModelvehicle/int- A vehicle or a model ID.
Returns
The vehicle type, or false.
Example
addEventHandler("onVehicleEnter", root, function(player, seat)
if seat == 0 and getVehicleType(source) == "Plane" then
outputChatBox("Pamietaj o licencji pilota.", player)
end
end)
See also
getVehicleTypeFromModelReturns the vehicle kind for a model number (likegetVehicleType). A new model fromengineRequestModelhas its base model's type.getVehicleModelsOfTypeReturns the numbers of all models of a kind, e.g. all boats or helicopters. Useful for picking a random vehicle of a specific type.