Player.ExitVehicle

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:ExitVehicle( )
Description:
Forces a player out of a vehicle.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.ExitVehicle]Player.ExitVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionIf anyone is in a vehicle, force him out of it
Used onNewerServer.png
Code
for _, v in pairs ( player.GetAll() ) do --For every player...
    if ( v:InVehicle() ) then --If he's in a vehicle...
        v:ExitVehicle() --Get the hell out!
    end
end
OutputN/A

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox