<?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=Kheprafish</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=Kheprafish"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Kheprafish"/>
	<updated>2026-04-11T15:19:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:CreateMarker&amp;diff=15107</id>
		<title>Talk:CreateMarker</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:CreateMarker&amp;diff=15107"/>
		<updated>2008-01-19T07:06:17Z</updated>

		<summary type="html">&lt;p&gt;Kheprafish: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is there a way to set the rotation of a marker?--[[User:Kheprafish|Kheprafish]] 12:44, 18 January 2008 (CST)&lt;br /&gt;
:Markers don't have a rotation... You might be thinking of [[setMarkerTarget]]... [[User:EAi|eAi]] 13:13, 18 January 2008 (CST)&lt;br /&gt;
::Ah, thanks.  It just seems a little strange to orient ring markers this way--[[User:Kheprafish|Kheprafish]] 01:06, 19 January 2008 (CST)&lt;/div&gt;</summary>
		<author><name>Kheprafish</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:CreateMarker&amp;diff=15091</id>
		<title>Talk:CreateMarker</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:CreateMarker&amp;diff=15091"/>
		<updated>2008-01-18T18:44:48Z</updated>

		<summary type="html">&lt;p&gt;Kheprafish: New page: Is there a way to set the rotation of a marker?--~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is there a way to set the rotation of a marker?--[[User:Kheprafish|Kheprafish]] 12:44, 18 January 2008 (CST)&lt;/div&gt;</summary>
		<author><name>Kheprafish</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleCompatibleUpgrades&amp;diff=15012</id>
		<title>GetVehicleCompatibleUpgrades</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleCompatibleUpgrades&amp;diff=15012"/>
		<updated>2008-01-14T23:56:53Z</updated>

		<summary type="html">&lt;p&gt;Kheprafish: fix eventHandler code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking| Are all vehicle updates listed? I didn't see wheel updates in the list for instance.}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a table of all the compatible upgrades (or all for a specified slot, optionally) for a specifed vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getVehicleCompatibleUpgrades ( vehicle theVehicle, [int slot] )&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 retrieve the list of compatible upgrades of.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''slot:''' The upgrade slot number for which you're getting the list (from 0 to 16). Compatible upgrades for all slots are listed if this is not specified.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' with all the compatible upgrades, or ''false'' if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example displays a list of all the compatible upgrades for a vehicle when you enter it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptOnPlayerEnterVehicle ( invehicle, seat, jacked )&lt;br /&gt;
  local upgrades = getVehicleCompatibleUpgrades ( invehicle )&lt;br /&gt;
  for upgradeKey, upgradeValue in ipairs ( upgrades ) do&lt;br /&gt;
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeValue ) .. &amp;quot;: &amp;quot; .. upgradeValue )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleEnter&amp;quot;, getRootElement(), scriptOnPlayerEnterVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Kheprafish</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateVehicle&amp;diff=14951</id>
		<title>CreateVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateVehicle&amp;diff=14951"/>
		<updated>2008-01-14T09:01:17Z</updated>

		<summary type="html">&lt;p&gt;Kheprafish: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function creates a vehicle at the specified location.&lt;br /&gt;
&lt;br /&gt;
Its worth noting that the position of the vehicle is the center point of the vehicle, not its base. As such, you need to ensure that the z value (vertical axis) is some height above the ground. You can find the exact height using the client side function [[getElementDistanceFromCentreOfMassToBaseOfModel]], or you can estimate it yourself and just spawn the vehicle so it drops to the ground.&lt;br /&gt;
&lt;br /&gt;
'''Important Note:''' Vehicles created client side are only seen by the client that creates, them, aren't synced and players cannot enter them. They are essentially for display only.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicle createVehicle ( int model, float x, float y, float z, [float rx, float ry, float rz, string numberplate] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''model''': The [[Vehicle IDs|vehicle ID]] of the vehicle being created.&lt;br /&gt;
* '''x''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''y''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''z''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''rx''': A floating point number representing the rotation about the X axis in degrees.&lt;br /&gt;
* '''ry''': A floating point number representing the rotation about the Y axis in degrees.&lt;br /&gt;
* '''rz''': A floating point number representing the rotation about the Z axis in degrees.&lt;br /&gt;
* '''numberplate''': A string that will go on the number plate of the car (max 8 characters). This is only applicable to [[cars]].&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[vehicle]] element that was created. Returns ''false'' if the arguments are incorrect, or if the vehicle limit of 65535 is exceeded.&lt;br /&gt;
&lt;br /&gt;
==Using trains==&lt;br /&gt;
Trains are created using the createVehicle function. They are placed at the nearest point of the GTASA train pathing (railroad tracks) from their spawning point. &lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a Rhino on top of one lucky individual.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptCreateTank ( player, command )&lt;br /&gt;
      local luckyBugger = getRandomPlayer() -- get a random player&lt;br /&gt;
      local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position&lt;br /&gt;
      createVehicle ( 432, x, y, z + 10 ) -- create the tank 10 units above them&lt;br /&gt;
      outputChatBox ( &amp;quot;You got Tank'd!&amp;quot;, luckyBugger )&lt;br /&gt;
end&lt;br /&gt;
--Attach the 'scriptCreateTank' function to the &amp;quot;tank&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;tank&amp;quot;, scriptCreateTank )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a Rhino on top of the local player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptCreateTank ( commandName )&lt;br /&gt;
      local luckyBugger = getLocalPlayer() -- get the local player&lt;br /&gt;
      local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position&lt;br /&gt;
      createVehicle ( 432, x, y, z + 10 ) -- create the tank 10 units above them&lt;br /&gt;
      outputChatBox ( &amp;quot;You got Tank'd!&amp;quot;, luckyBugger )&lt;br /&gt;
end&lt;br /&gt;
--Attach the 'scriptCreateTank' function to the &amp;quot;tank&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;tank&amp;quot;, scriptCreateTank )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a vehicle five units to the right of a player when they type ''createvehicle'' and its name in the console:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local distance = 5 --units&lt;br /&gt;
&lt;br /&gt;
-- define our handler (we'll take a variable number of parameters where the name goes, because there are vehicle names with more than one word)&lt;br /&gt;
function consoleCreateVehicle ( sourcePlayer, commandName, ... )&lt;br /&gt;
   -- if a player triggered it, not the admin,&lt;br /&gt;
   if ( sourcePlayer ) then&lt;br /&gt;
      -- calculate the position of the vehicle based on the player's position and rotation:&lt;br /&gt;
      local x, y, z = getElementPosition ( sourcePlayer ) -- get the player's position&lt;br /&gt;
      local rotZ = getPlayerRotation ( sourcePlayer ) -- get the player's rotation around the Z axis in degrees&lt;br /&gt;
      x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * distance ) -- calculate the X position of the vehicle&lt;br /&gt;
      y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * distance ) -- calculate the Y position of the vehicle&lt;br /&gt;
&lt;br /&gt;
      -- get the complete vehicle name by joining all passed parameters using Lua function table.concat&lt;br /&gt;
      local vehicleName = table.concat({...}, &amp;quot; &amp;quot;)&lt;br /&gt;
      -- get the vehicle's model ID from the name&lt;br /&gt;
      local vehicleID = getVehicleIDFromName ( vehicleName )&lt;br /&gt;
      -- if vehicle ID is valid,&lt;br /&gt;
      if vehicleID then&lt;br /&gt;
            -- create the vehicle using the information gathered above:&lt;br /&gt;
            local newVehicle = createVehicle ( vehicleID, x, y, z, 0, 0, rotZ )&lt;br /&gt;
            -- if vehicle creation failed, give the player a message&lt;br /&gt;
            if ( newVehicle == false ) then&lt;br /&gt;
               outputConsole ( &amp;quot;Failed to create vehicle.&amp;quot;, sourcePlayer )&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Attach the 'consoleCreateVehicle' function to the &amp;quot;createvehicle&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;createvehicle&amp;quot;, consoleCreateVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{IDs}}&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Kheprafish</name></author>
	</entry>
</feed>