GetVehicleIndexFromEntityIndex
Docslocal retval = GetVehicleIndexFromEntityIndex(entity)Description
Simply returns whatever is passed to it (Regardless of whether the handle is valid or not).
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | — |
Quick Snippet: Get Vehicle→ Vehicle
→ VehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endQuick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
VehicleReturns a vehicle handle.