GetVehicleType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:


===Returns===
===Returns===
Returns a ''string'' with vehicle type or ''false'' if an invalid modelID has been supplied, or an empty string if the vehicle is blocked internally (some trailers). Works server- and clientside.
Returns a ''string'' with vehicle type or ''false'' if an invalid modelID has been supplied, or an empty string if the vehicle is blocked internally (some trailers).


'''types:'''
Possible strings returned:
* '''Automobile'''
* '''Automobile''': Cars, vans and trucks
* '''Plane'''
* '''Plane'''
* '''Bike'''
* '''Bike''': Motorbikes
* '''Helicopter'''
* '''Helicopter'''
* '''Boat'''
* '''Boat'''
* '''Train'''
* '''Train'''
* '''Trailer'''
* '''Trailer''': A trailer for a truck
* '''BMX'''
* '''BMX'''
* '''Monster Truck'''
* '''Monster Truck'''
* '''Quad'''
* '''Quad''': Quadbikes


==Example==  
==Example==  

Revision as of 20:53, 14 April 2008

This function retrieves the type of a vehicle (such as if it is a car or a boat).

Syntax

string getVehicleType ( vehicle theVehicle )

OR

string getVehicleType ( int modelId )

Required Arguments

  • vehicle: The vehicle element to get the type of.
  • modelId: A vehicle model id

Returns

Returns a string with vehicle type or false if an invalid modelID has been supplied, or an empty string if the vehicle is blocked internally (some trailers).

Possible strings returned:

  • Automobile: Cars, vans and trucks
  • Plane
  • Bike: Motorbikes
  • Helicopter
  • Boat
  • Train
  • Trailer: A trailer for a truck
  • BMX
  • Monster Truck
  • Quad: Quadbikes

Example


See Also