Gamemode.CanPlayerEnterVehicle

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameCanPlayerEnterVehicle
SyntaxGM:CanPlayerEnterVehicle( Player Player, Vehicle Vehicle, Integer role )
DescriptionCalled when a player attempts to enter a vehicle.
ReturnsBoolean
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.CanPlayerEnterVehicle]Gamemode.CanPlayerEnterVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionOnly allows admins to enter vehicles
Used onNewerServer.png
Code
 
function CanPlayerEnterVehicle( player, vehicle, role )
	if !(player:IsAdmin()) then return false end
end
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox