Player.GetVehicle
From GMod Wiki
Revision as of 17:19, 25 September 2009 by Crazy Quebecer (Talk | contribs)
| 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.