<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Syytuvanaema</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Syytuvanaema"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Syytuvanaema"/>
	<updated>2026-06-02T02:30:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerJoin&amp;diff=17637</id>
		<title>OnPlayerJoin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerJoin&amp;diff=17637"/>
		<updated>2008-08-25T20:14:47Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player joins the server.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[player]] who joined.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the joined client's name and sends him a welcome message including his name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we register greetPlayer as a handler for the event&lt;br /&gt;
function greetPlayer ( )&lt;br /&gt;
	-- we store the player's name&lt;br /&gt;
	local joinedPlayerName = getClientName ( source )&lt;br /&gt;
	local serverName = getServerName( )&lt;br /&gt;
	-- and send him a greeting&lt;br /&gt;
	outputChatBox ( &amp;quot;Welcome &amp;quot; .. joinedPlayerName .. &amp;quot; to &amp;quot;.. serverName ..&amp;quot;!&amp;quot; , source, 255, 255, 255 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), greetPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example sets random color to every player who joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- sets colors when player join&lt;br /&gt;
function onJoin ()&lt;br /&gt;
	g_Red, g_Green, g_Blue = randInt (50, 255), randInt (50, 255), randInt (50, 255)&lt;br /&gt;
end&lt;br /&gt;
-- checks if player has sent a message&lt;br /&gt;
function onChat ( message, messageType )&lt;br /&gt;
	if messageType == 0 then&lt;br /&gt;
		local root = getRootElement()&lt;br /&gt;
		outputChatBox ( getClientName ( source ) .. &amp;quot;: #E0D0B0&amp;quot; .. message, getRootElement(), g_Red, g_Green, g_Blue, true )&lt;br /&gt;
		cancelEvent()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), onJoin)&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), onChat )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChat&amp;diff=17636</id>
		<title>OnPlayerChat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChat&amp;diff=17636"/>
		<updated>2008-08-25T20:14:13Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player chats inside the chat box.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string message, int messageType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''message''': A string representing the message typed into the chat.&lt;br /&gt;
*'''messageType''': An integer value representing the message type:&lt;br /&gt;
**'''0''': normal message&lt;br /&gt;
**'''1''': action message (/me)&lt;br /&gt;
**'''2''': team message&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who sent the chatbox message.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the game's chat system won't deliver the posts. You may use [[outputChatBox]] to send the messages then.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example limits receiving of chat messages to a spherical area around the player who sent the message, also blocking action and team text.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define our chat radius&lt;br /&gt;
local chatRadius = 20 --units&lt;br /&gt;
&lt;br /&gt;
-- define a handler that will distribute the message to all nearby players&lt;br /&gt;
function sendMessageToNearbyPlayers( message, messageType )&lt;br /&gt;
    -- we will only send normal chat messages, action and team types will be ignored&lt;br /&gt;
    if messageType == 0 then&lt;br /&gt;
        -- get the chatting player's position&lt;br /&gt;
        local posX, posY, posZ = getElementPosition( source )&lt;br /&gt;
        &lt;br /&gt;
        -- create a sphere of the specified radius in that position&lt;br /&gt;
        local chatSphere = createColSphere( posX, posY, posZ, chatRadius )&lt;br /&gt;
        -- get a table all player elements inside it&lt;br /&gt;
        local nearbyPlayers = getElementsWithinColShape( chatSphere, &amp;quot;player&amp;quot; )&lt;br /&gt;
        -- and destroy the sphere, since we're done with it&lt;br /&gt;
        destroyElement( chatSphere )&lt;br /&gt;
        &lt;br /&gt;
        -- deliver the message to each player in that table&lt;br /&gt;
        for index, nearbyPlayer in ipairs( nearbyPlayers ) do&lt;br /&gt;
            outputChatBox( message, nearbyPlayer )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- attach our new chat handler to onPlayerChat&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), sendMessageToNearbyPlayers )&lt;br /&gt;
&lt;br /&gt;
-- define another handler function that cancels the event so that the message won't be delivered through the &lt;br /&gt;
function blockChatMessage()&lt;br /&gt;
    cancelEvent()&lt;br /&gt;
end&lt;br /&gt;
-- attach it as a handler to onPlayerChat&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), blockChatMessage )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example sets random color to every player who joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- sets colors when player join&lt;br /&gt;
function onJoin ()&lt;br /&gt;
	g_Red, g_Green, g_Blue = randInt (50, 255), randInt (50, 255), randInt (50, 255)&lt;br /&gt;
end&lt;br /&gt;
-- checks if player has sent a message&lt;br /&gt;
function onChat ( message, messageType )&lt;br /&gt;
	if messageType == 0 then&lt;br /&gt;
		local root = getRootElement()&lt;br /&gt;
		outputChatBox ( getClientName ( source ) .. &amp;quot;: #E0D0B0&amp;quot; .. message, getRootElement(), g_Red, g_Green, g_Blue, true )&lt;br /&gt;
		cancelEvent()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), onJoin)&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), onChat )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChat&amp;diff=17635</id>
		<title>OnPlayerChat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChat&amp;diff=17635"/>
		<updated>2008-08-25T20:13:44Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player chats inside the chat box.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string message, int messageType&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''message''': A string representing the message typed into the chat.&lt;br /&gt;
*'''messageType''': An integer value representing the message type:&lt;br /&gt;
**'''0''': normal message&lt;br /&gt;
**'''1''': action message (/me)&lt;br /&gt;
**'''2''': team message&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who sent the chatbox message.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the game's chat system won't deliver the posts. You may use [[outputChatBox]] to send the messages then.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example limits receiving of chat messages to a spherical area around the player who sent the message, also blocking action and team text.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define our chat radius&lt;br /&gt;
local chatRadius = 20 --units&lt;br /&gt;
&lt;br /&gt;
-- define a handler that will distribute the message to all nearby players&lt;br /&gt;
function sendMessageToNearbyPlayers( message, messageType )&lt;br /&gt;
    -- we will only send normal chat messages, action and team types will be ignored&lt;br /&gt;
    if messageType == 0 then&lt;br /&gt;
        -- get the chatting player's position&lt;br /&gt;
        local posX, posY, posZ = getElementPosition( source )&lt;br /&gt;
        &lt;br /&gt;
        -- create a sphere of the specified radius in that position&lt;br /&gt;
        local chatSphere = createColSphere( posX, posY, posZ, chatRadius )&lt;br /&gt;
        -- get a table all player elements inside it&lt;br /&gt;
        local nearbyPlayers = getElementsWithinColShape( chatSphere, &amp;quot;player&amp;quot; )&lt;br /&gt;
        -- and destroy the sphere, since we're done with it&lt;br /&gt;
        destroyElement( chatSphere )&lt;br /&gt;
        &lt;br /&gt;
        -- deliver the message to each player in that table&lt;br /&gt;
        for index, nearbyPlayer in ipairs( nearbyPlayers ) do&lt;br /&gt;
            outputChatBox( message, nearbyPlayer )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- attach our new chat handler to onPlayerChat&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), sendMessageToNearbyPlayers )&lt;br /&gt;
&lt;br /&gt;
-- define another handler function that cancels the event so that the message won't be delivered through the &lt;br /&gt;
function blockChatMessage()&lt;br /&gt;
    cancelEvent()&lt;br /&gt;
end&lt;br /&gt;
-- attach it as a handler to onPlayerChat&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), blockChatMessage )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example sets random color to every player who join.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- sets colors when player join&lt;br /&gt;
function onJoin ()&lt;br /&gt;
	g_Red, g_Green, g_Blue = randInt (50, 255), randInt (50, 255), randInt (50, 255)&lt;br /&gt;
end&lt;br /&gt;
-- checks if player has sent a message&lt;br /&gt;
function onChat ( message, messageType )&lt;br /&gt;
	if messageType == 0 then&lt;br /&gt;
		local root = getRootElement()&lt;br /&gt;
		outputChatBox ( getClientName ( source ) .. &amp;quot;: #E0D0B0&amp;quot; .. message, getRootElement(), g_Red, g_Green, g_Blue, true )&lt;br /&gt;
		cancelEvent()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), onJoin)&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), onChat )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17632</id>
		<title>SpawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17632"/>
		<updated>2008-08-24T19:34:40Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Spawns a vehicle at any given position and rotation&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool spawnVehicle ( vehicle theVehicle, float x, float y, float z, float rx, float ry, float rz )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to spawn&lt;br /&gt;
*'''x:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''y:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''z:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''rx:''' The x rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''ry:''' The y rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''rz:''' The z rotation you wish to spawn the vehicle at&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle spawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
There is no exmple.&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17631</id>
		<title>SpawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17631"/>
		<updated>2008-08-24T19:08:58Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Spawns a vehicle at any given position and rotation&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool spawnVehicle ( vehicle theVehicle, float x, float y, float z, float rx, float ry, float rz )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to spawn&lt;br /&gt;
*'''x:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''y:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''z:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''rx:''' The x rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''ry:''' The y rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''rz:''' The z rotation you wish to spawn the vehicle at&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle spawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
NEEDS CHECKING&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a car 5 units to the right of player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function spawncar( source, commandName, carid )&lt;br /&gt;
	if ( isPlayerInVehicle ( source ) == false ) then&lt;br /&gt;
		local x, y, z = getElementPosition ( source )&lt;br /&gt;
		local rotZ = getPlayerRotation ( source )&lt;br /&gt;
		x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		if ( spawnVehicle ( carid, x, y, z, 0, 0, rotZ ) ) then&lt;br /&gt;
			outputChatBox ( &amp;quot;You spawned a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Failed to spawn a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;car&amp;quot;, spawncar )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17630</id>
		<title>SpawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17630"/>
		<updated>2008-08-24T19:02:26Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Spawns a vehicle at any given position and rotation&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool spawnVehicle ( vehicle theVehicle, float x, float y, float z, float rx, float ry, float rz )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to spawn&lt;br /&gt;
*'''x:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''y:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''z:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''rx:''' The x rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''ry:''' The y rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''rz:''' The z rotation you wish to spawn the vehicle at&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle spawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
NEEDS CHECKING&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a car 5 units to the right of player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function spawncar( source, commandName, carid )&lt;br /&gt;
	if ( isPlayerInVehicle ( source ) == false ) then&lt;br /&gt;
		local x, y, z = getElementPosition ( source )&lt;br /&gt;
		local rotZ = getPlayerRotation ( source )&lt;br /&gt;
		x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		if ( spawnVehicle ( carid, x, y, z, 0, 0, rotZ ) ) then&lt;br /&gt;
			outputChatBox ( &amp;quot;You spawned a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Failed to spawn a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;car&amp;quot;, spawncar )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17629</id>
		<title>SpawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17629"/>
		<updated>2008-08-24T19:00:59Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Spawns a vehicle at any given position and rotation&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool spawnVehicle ( vehicle theVehicle, float x, float y, float z, float rx, float ry, float rz )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to spawn&lt;br /&gt;
*'''x:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''y:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''z:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''rx:''' The x rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''ry:''' The y rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''rz:''' The z rotation you wish to spawn the vehicle at&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle spawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
There is currently no example - Do you have one? if so submit it!&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a car 5 units to the right of player (NEEDS CHECKING).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function spawncar( source, commandName, carid )&lt;br /&gt;
	if ( isPlayerInVehicle ( source ) == false ) then&lt;br /&gt;
		local x, y, z = getElementPosition ( source )&lt;br /&gt;
		local rotZ = getPlayerRotation ( source )&lt;br /&gt;
		x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		if ( spawnVehicle ( carid, x, y, z, 0, 0, rotZ ) ) then&lt;br /&gt;
			outputChatBox ( &amp;quot;You spawned a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Failed to spawn a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;car&amp;quot;, spawncar )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17628</id>
		<title>SpawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnVehicle&amp;diff=17628"/>
		<updated>2008-08-24T19:00:13Z</updated>

		<summary type="html">&lt;p&gt;Syytuvanaema: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Spawns a vehicle at any given position and rotation&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool spawnVehicle ( vehicle theVehicle, float x, float y, float z, float rx, float ry, float rz )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to spawn&lt;br /&gt;
*'''x:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''y:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''z:''' The x position you wish to spawn the vehicle at&lt;br /&gt;
*'''rx:''' The x rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''ry:''' The y rotation you wish to spawn the vehicle at&lt;br /&gt;
*'''rz:''' The z rotation you wish to spawn the vehicle at&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle spawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
There is currently no example - Do you have one? if so submit it!&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a car 5 units to the right of player (NEEDS CHECKING).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function spawncar( source, commandName, carid )&lt;br /&gt;
	if ( isPlayerInVehicle ( source ) == false ) then&lt;br /&gt;
		local x, y, z = getElementPosition ( source )&lt;br /&gt;
		local rotZ = getPlayerRotation ( source )&lt;br /&gt;
		x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * 5 )&lt;br /&gt;
		if ( spawnVehicle ( carid, x, y, z, 0, 0, rotZ ) ) then&lt;br /&gt;
			outputChatBox ( &amp;quot;You spawned a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Failed to spawn a car!&amp;quot;, source, 0, 255, 0, true )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;car&amp;quot;, spawncar )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Syytuvanaema</name></author>
	</entry>
</feed>