_GET_IS_VEHICLE_ELECTRIC
Docslocal retval = GetIsVehicleElectric(vehicleModel)Description
Introduced in build 3258
Checks if the vehicle is electric.
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
BOOLReturns TRUE (1) or FALSE (0).
Examples
Official
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
-- GetVehiclePedIsIn will return 0 if the ped isn't currently in a vehicle
if veh == 0 then return end
local model = GetEntityModel(veh)
if GetIsVehicleElectric(model) then
print("This vehicle is electric")
else
print("This vehicle is not electric")
end