GetVehicleModelFromName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 43395 by Strix (talk))
(add oop syntax)
Line 7: Line 7:
int getVehicleModelFromName ( string name )             
int getVehicleModelFromName ( string name )             
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP|This function is a static function underneath the Vehicle class.|[[Vehicle]].getModelFromName}}
===Required Arguments===  
===Required Arguments===  
*'''name:''' A [[string]] containing the name of the vehicle.
*'''name:''' A [[string]] containing the name of the vehicle.

Revision as of 19:04, 2 January 2015

This function retrieves the model ID of a vehicle as an integer value from its name.

Syntax

int getVehicleModelFromName ( string name )             

OOP Syntax Help! I don't understand this!

Note: This function is a static function underneath the Vehicle class.
Method: Vehicle.getModelFromName(...)


Required Arguments

  • name: A string containing the name of the vehicle.

Returns

Returns an integer if the name exists, false otherwise. If you use this function on vehicles with shared names, such as "police", it will return the earliest occurrence of that vehicle's ID.

Example

Click to expand [+]
Server

See Also

Shared