_GET_VEHICLE_DRIVETRAIN_TYPE
Docslocal retval = GetVehicleDrivetrainType(vehicleModel)Description
Introduced in build 3258
Note: When using this native, the hash of the vehicle needs to be loaded into the client's memory. This can be done by requesting the model with <code>REQUEST_MODEL</code> or by simply having the vehicle spawned.
enum eVehicleDrivetrainType
{
INVALID = 0,
FWD = 1,
RWD = 2,
AWD = 3
};NativeDB Introduced: v3258
Parameters
| Name | Type | Description |
|---|---|---|
vehicleModel | Hash | The hash of the vehicle model to check. |
Quick Snippet: Load Model HashvehicleModel
vehicleModelModels must be loaded before use. This snippet handles requesting and releasing properly.
-- Properly load a model before spawning/using it
local modelName = "prop_barrel_01a" -- change to your model
local modelHash = GetHashKey(modelName)
RequestModel(modelHash)
while not HasModelLoaded(modelHash) do
Wait(0)
end
print("Model loaded: " .. modelName .. " (" .. modelHash .. ")")
-- Release when done:
-- SetModelAsNoLongerNeeded(modelHash)Vehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
intReturns an integer value.
Examples
Official
local vehicleHash = GetHashKey("elegy")
RequestModel(vehicleHash)
repeat
Wait(0)
until HasModelLoaded(vehicleHash)
local driveTrainType = GetVehicleDriveTrainType(vehicleHash)
if driveTrainType == 1 then
-- FWD
print(GetLabelText("FMMC_DT_FWD"))
elseif driveTrainType == 2 then
-- RWD
print(GetLabelText("FMMC_DT_RWD"))
elseif driveTrainType == 3 then
-- AWD
print(GetLabelText("FMMC_DT_AWD"))
else
print("invalid")
end