Player.InVehicle

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:InVehicle( )
Description:
Returns true if the player is inside a vehicle, else false.
Returns: Boolean
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.InVehicle]Player.InVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionReturns true if the player is in a vehicle, false if they're not.
Used onNewerClient.png
Code
function VehicleCheck()
	ply = LocalPlayer()
	if ply:InVehicle() then
		return true
	else
		return false
	end
end
OutputIf a player is in a vehicle, true, else, false.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox