Gamemode.CanPlayerEnterVehicle

From GMod Wiki

Revision as of 06:25, 24 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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