Difference between revisions of "GetCurrentVehicleEntityId"

From Nomad DB
(Created page with "Returns the EntityId of the Vehicle, that a Player/NPC is sitting in. == Syntax == <pre> GetCurrentVehicleEntityId(EntityId) </pre> * '''EntityId''' of target Player/...")
(No difference)

Revision as of 18:01, 14 April 2020

Returns the EntityId of the Vehicle, that a Player/NPC is 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