Gamemode.CanExitVehicle

From GMod Wiki

Revision as of 15:11, 17 February 2011 by BlackVoid (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameCanExitVehicle
SyntaxGM:CanExitVehicle( Vehicle vehicle, Player ply )
DescriptionCalled when a player tries to exit a vehicle. Return true to allow, false to deny.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.CanExitVehicle]Gamemode.CanExitVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDetermine whether or not a player can exit a vehicle.
Used onNewerServer.png
Code
function GM:CanExitVehicle ( vehicle, ply )
     ply:ChatPrint("You can't exit: " .. vehicle:GetClass() )
     return false 
end
OutputThe player is forced to stay in the vehicle.


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox