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

Function

engineGetModelIDFromName

Returns a model number by name. On the server it finds new named models (engineRequestModel) and vehicles; on the client also game models by name.

Syntax

int engineGetModelIDFromName(string modelName)

Arguments

modelNamestring
Model name.

Differences from MTA:SA

  • In MTA:SA this function is client-side only.

In MTA:SA

engineGetModelIDFromName(string modelName)

Returns

The number or false.

Example

local id = engineGetModelIDFromName("elegy_drift")
if id then createVehicle(id, 0, 0, 3) end

See also