Gamemode.PlayerSpawnVehicle

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnVehicle
SyntaxGM:PlayerSpawnVehicle( Player player, String model, String vehicle name, Table vehicle table )
DescriptionCalled when a player wants to spawn a vehicle, before it is spawned.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnVehicle]Gamemode.PlayerSpawnVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDisallows spawning of any vehicle at all. Useful for Linux servers, which crash when a vehicle is spawned.
Used onNewerServer.png
Code
hook.Add( "PlayerSpawnVehicle", "NoVehicles", function()
   return false
end )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox