Player.GetVehicle

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:GetVehicle( )
Description:
Returns the Vehicle Entity that the player is driving.
Returns: Entity Vehicle
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.GetVehicle]Player.GetVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis will return the class of the vehicle player 1 is inside.
Used onNewerServer.png
Code
print( player.GetByID(1):GetVehicle():GetClass() )
OutputN/A



Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox