GetVehicleType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
{{Server client function}}
{{Server client function}}
{{New feature|3|DP3|
{{New feature|3|DP3|
This function retrieves the vehicle type
This function retrieves the type of a vehicle (such as if it is a car or a boat).
}}
}}
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string getVehicleType ( vehicle theVehicle )
string getVehicleType ( vehicle theVehicle )
string getVehicleType ( integer modelId )
</syntaxhighlight>  
</syntaxhighlight>  
'''OR'''
<syntaxhighlight lang="lua">
string getVehicleType ( int modelId )
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
*'''vehicle:''' The vehicle element or id.
*'''vehicle:''' The vehicle element to get the type of.
*'''modelId:''' A vehicle model id


===Returns===
===Returns===
Line 17: Line 23:


'''types:'''
'''types:'''
Automobile<br /> Plane<br /> Bike<br /> Helicopter<br /> Boat<br /> Train<br /> Trailer<br /> BMX<br /> Monster Truck<br /> Quad
* '''Automobile'''
* '''Plane'''
* '''Bike'''
* '''Helicopter'''
* '''Boat'''
* '''Train'''
* '''Trailer'''
* '''BMX'''
* '''Monster Truck'''
* '''Quad'''


==Example==  
==Example==  
Line 26: Line 41:
==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}
[[Category:Needs Example]]

Revision as of 20:51, 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). Works server- and clientside.

types:

  • Automobile
  • Plane
  • Bike
  • Helicopter
  • Boat
  • Train
  • Trailer
  • BMX
  • Monster Truck
  • Quad

Example


See Also