spawnVehicle | Multi Theft Auto: Wiki Skip to content

spawnVehicle

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Spawns a vehicle at any given position and rotation

Syntax

spawnVehicle ( )

Code Examples

server

With this feature, we spawn vehicle

function myCommandHandler(thePlayer, command)
local x, y, z = getElementPosition(thePlayer)
local RaceVehicle = createVehicle ( 411, 0, 0, 0 )
local spawnVeh = spawnVehicle ( RaceVehicle, x+3, y+3, z )
if spawnVeh then outputChatBox("Vehicle was spawned", thePlayer) else outputChatBox("Error",thePlayer) end
end
addCommandHandler("spawnvehicle", myCommandHandler)

See Also

Vehicle Functions