GetCurrentVehicleEntityId

From Nomad DB
Revision as of 18:59, 14 April 2020 by Jan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns the Entity ID of the vehicle that the specified pawn is currently sitting in.

Syntax

GetCurrentVehicleEntityId(EntityId)

Example

This function checks if the local player is sitting in a vehicle.

local function IsPlayerInVehicle()
	local plyId = GetLocalPlayerEntityId()
	if plyId == GetInvalidEntityId() then
		return false
	end
	return GetCurrentVehicleEntityId(plyId) ~= GetInvalidEntityId() 
end

Related Pages