Player.GetVehicle
From GMod Wiki
Function | |
Syntax | Player:GetVehicle( ) |
Description: | |
Returns the Vehicle Entity that the player is driving. | |
Returns: | Entity Vehicle |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.GetVehicle]Player.GetVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This will return the class of the vehicle player 1 is inside. |
---|---|
Used on | |
Code | print( player.GetByID(1):GetVehicle():GetClass() ) |
Output | N/A |
Additional Notes
- Returns nil if the player isn't inside a vehicle.