ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehicleType

Function

getVehicleType

Server and clientVehiclesIdentical to MTA:SA

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