<?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=VRocker2</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=VRocker2"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/VRocker2"/>
	<updated>2026-04-27T13:57:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:VRocker&amp;diff=8447</id>
		<title>User:VRocker</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:VRocker&amp;diff=8447"/>
		<updated>2007-05-31T17:11:35Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Too lazy to write anything here...&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=8211</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=8211"/>
		<updated>2007-05-07T13:45:31Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|I don't think any of the &amp;quot;colcube&amp;quot;, &amp;quot;colsphere&amp;quot;, &amp;quot;coltube&amp;quot;, &amp;quot;colcircle&amp;quot; or &amp;quot;colsquare work at all.  I've only been able to use &amp;quot;colshape&amp;quot; which isnt even listed here.}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retreive a list of all elemets of the specified type. This can be useful, as it disregards ''where'' in the element table it is in the element heirarchy. It can be used with either the built in types (listed below) or with any type used in the .map file. For example, if there is an element of type &amp;quot;flag&amp;quot; (e.g. &amp;lt;flag /&amp;gt;) in the .map file, the using &amp;quot;flag&amp;quot; as the type argument would find it.&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 getElementsByType ( string type, [ element startat=getRootElement() ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''type:''' The type of element you want a list of. This is the same as the tag name in the .map file, so this can be used with a custom element type if desired. Built in types are:&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''': A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;colcube&amp;quot;:''' A cube collision shape&lt;br /&gt;
**'''&amp;quot;colsphere&amp;quot;:''' A sphere collision shape&lt;br /&gt;
**'''&amp;quot;coltube&amp;quot;:''' A tube collision shape&lt;br /&gt;
**'''&amp;quot;colcircle&amp;quot;:''' A circle collision shape&lt;br /&gt;
**'''&amp;quot;colsquare&amp;quot;:''' A square collision shape&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;radararea&amp;quot;:''' A radar area&lt;br /&gt;
**'''&amp;quot;team&amp;quot;:''' A team&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;remoteclient&amp;quot;:''' A remote client connected to the server&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''startat:''' The [[element]] the search should start at. Children of this element are searched, siblings or parents will not be found. By default, this is the root element which should suit most uses.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example retrieves a table of the players in the server, and checks whether or not each one is in a vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- get a table of all the players in the server&lt;br /&gt;
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player&lt;br /&gt;
   if ( isPlayerInVehicle ( thePlayer ) ) then -- if the player is in a vehicle, announce it&lt;br /&gt;
      outputChatBox ( getClientName ( thePlayer ) .. &amp;quot; is in a vehicle&amp;quot; )&lt;br /&gt;
   else -- if the player isn't in a vehicle, announce that he/she is on foot&lt;br /&gt;
      outputChatBox ( getClientName ( thePlayer ) .. &amp;quot; is on foot&amp;quot; )&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SpawnPlayer&amp;diff=8200</id>
		<title>SpawnPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SpawnPlayer&amp;diff=8200"/>
		<updated>2007-05-06T22:52:18Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function spawns the player at an arbitary point on the map.&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 spawnPlayer ( player thePlayer, float x, float y, float z, int rotation, int skinID, [ int interior = 0, int dimension = 0, team theTeam = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the player at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the player at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the player at&lt;br /&gt;
*'''rotation:''' rotation of the player on spawn&lt;br /&gt;
*'''skinID:''' players skin on spawn&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''interior:''' interior the player will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the player should be in&lt;br /&gt;
*'''theTeam:''' the team the player will join&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player was spawned successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example spawns all the players in the map at the first spawnpoint there is.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a table of all the players&lt;br /&gt;
players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
-- Go through every player&lt;br /&gt;
for playerKey, playerValue in ipairs(players) do&lt;br /&gt;
	-- Spawn them at the desired coordinates&lt;br /&gt;
	spawnPlayer ( playerValue, 0.0, 0.0, 0.0, 90.0, 7 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleFrozen&amp;diff=8199</id>
		<title>SetVehicleFrozen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleFrozen&amp;diff=8199"/>
		<updated>2007-05-06T22:40:17Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function freezes a vehicle (stops it in its position and disables movement) or unfreezes it.&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 setVehicleFrozen ( vehicle theVehicle, bool freezeStatus )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' the [[vehicle]] whose freeze status we want to change.&lt;br /&gt;
*'''freezeStatus:''' whether we want to freeze or unfreeze it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns ''true'' if the vehicle was frozen, ''false'' if it wasn't or if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example binds the &amp;quot;p&amp;quot; key to a function to freeze/unfreeze the player's current vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we store all players in a table&lt;br /&gt;
local connectedPlayers = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
-- for each one in it,&lt;br /&gt;
for i, aPlayer in ipairs(connectedPlayers) do&lt;br /&gt;
	-- bind the player's &amp;quot;p&amp;quot; key to the toggleFreezeStatus function&lt;br /&gt;
	bindKey ( aPlayer, &amp;quot;p&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;toggleFreezeStatus&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- this function freezes the specified player's vehicle, if he's in one&lt;br /&gt;
function toggleFreezeStatus ( thePlayer )&lt;br /&gt;
	-- if he is in a vehicle,&lt;br /&gt;
	if isPlayerInVehicle ( thePlayer ) then&lt;br /&gt;
		-- get the vehicle element&lt;br /&gt;
		local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
		-- get the current freeze status&lt;br /&gt;
		local currentFreezeStatus = isVehicleFrozen ( playerVehicle )&lt;br /&gt;
		-- get the new freeze status (the opposite of the previous)&lt;br /&gt;
		local newFreezeStatus = not currentFreezeStatus&lt;br /&gt;
		-- set the new freeze status&lt;br /&gt;
		setVehicleFrozen ( playerVehicle, newFreezeStatus )&lt;br /&gt;
	end&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BlowVehicle&amp;diff=8198</id>
		<title>BlowVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BlowVehicle&amp;diff=8198"/>
		<updated>2007-05-06T22:37:37Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function will blow up a vehicle. This will cause an explosion and will kill the driver and any passengers inside it.&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 blowVehicle ( vehicle vehicleToBlow, [ bool explode=true ] )              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''vehicleToBlow:''' The vehicle that you wish to blow up.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''explode:''' If this argument is ''true'' then the vehicle will explode, otherwise it will just be blown up silently.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle was blown up, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will blow up every vehicle in the game.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; )&lt;br /&gt;
for vehicleKey, vehicleValue in ipairs(vehicles) do&lt;br /&gt;
	blowVehicle ( vehicleValue )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the same could be achieved with the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
root = getRootElement ()&lt;br /&gt;
blowVehicle ( root )&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleUpgrades&amp;diff=8197</id>
		<title>GetVehicleUpgrades</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleUpgrades&amp;diff=8197"/>
		<updated>2007-05-06T22:36:10Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns a table of all the upgrades on 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 getVehicleUpgrades ( vehicle theVehicle )&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 upgrades of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' of all the upgrades on each slot of a vehicle, which may be empty, or ''false'' if a valid vehicle is not passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerEnterVehicle&amp;quot;, root, &amp;quot;onPlayerEnterVehicle&amp;quot; )&lt;br /&gt;
function onPlayerEnterVehicle ( invehicle, seat, jacked )&lt;br /&gt;
  upgrades = getVehicleUpgrades ( invehicle )&lt;br /&gt;
  for upgradeKey, upgradeValue in ipairs(upgrades) do&lt;br /&gt;
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeKey - 1 ) .. &amp;quot;: &amp;quot; .. upgradeValue )&lt;br /&gt;
  end&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleUpgradeSlotName&amp;diff=8196</id>
		<title>GetVehicleUpgradeSlotName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleUpgradeSlotName&amp;diff=8196"/>
		<updated>2007-05-06T22:35:50Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the name of an upgrade slot name (e.g. roof, spoiler).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
There are two ways of using this function, the parameter can either be the slot ID (0 to 16) or an upgrade ID (1000 to 1193)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehicleUpgradeSlotName ( int slot/upgrade )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''slot/upgrade:''' the slot ID or corresponding upgrade ID of which you want the name.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' with the slot name if a valid slot or upgrade ID was given, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prints the name and upgrades on each slot of an entered vehicle to the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerEnterVehicle&amp;quot;, root, &amp;quot;onPlayerEnterVehicle&amp;quot; )&lt;br /&gt;
function onPlayerEnterVehicle ( vehicle, seat, jacked )&lt;br /&gt;
  upgrades = getVehicleUpgrades ( vehicle )&lt;br /&gt;
  for upgradeKey, upgradeValue in ipairs(upgrades) do&lt;br /&gt;
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeKey - 1 ) .. &amp;quot;: &amp;quot; .. upgradeValue )&lt;br /&gt;
  end&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleTurretPosition&amp;diff=8195</id>
		<title>GetVehicleTurretPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleTurretPosition&amp;diff=8195"/>
		<updated>2007-05-06T22:35:16Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function gets the position of a vehicle's turret, if it has one. Vehicles with turrets include firetrucks and tanks.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float getVehicleTurretPosition ( vehicle turretVehicle )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function also has two variants that allow you to retrieve data from just one of the two axes.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''turretVehicle''': The [[vehicle]] whose rotation you want to retrieve. This should be a vehicle with a turret with a player in.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two [[float]]s for the X (horizontal) and Y (vertical) axis rotation respectively. These values are in radians. The function will return ''false'' in the first return value if the vehicle does not have a driver or the vehicle is not a vehicle with a turret. &lt;br /&gt;
&lt;br /&gt;
{{UsingRadians}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find all the vehicles, and store them in a vehicles variable&lt;br /&gt;
vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; )&lt;br /&gt;
-- Loop through the vehicle list&lt;br /&gt;
for vehicleKey, vehicleValue in ipairs(vehicles) do&lt;br /&gt;
	-- Get the vehicle's turret position&lt;br /&gt;
	x, y = getVehicleTurretPosition ( vehicleValue ) &lt;br /&gt;
	-- If the vehicle has a turret (the function will return false if it doesn't) then&lt;br /&gt;
	if ( x ~= false )&lt;br /&gt;
		-- Tell everyone in the chat the turret's position&lt;br /&gt;
		outputChatBox ( &amp;quot;Turret position: &amp;quot; .. x .. &amp;quot;, &amp;quot; .. y .. &amp;quot;.&amp;quot; )	&lt;br /&gt;
	end&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleFrozen&amp;diff=8194</id>
		<title>IsVehicleFrozen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleFrozen&amp;diff=8194"/>
		<updated>2007-05-06T22:33:36Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function checks if a vehicle has been frozen.&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 isVehicleFrozen ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' the vehicle whose freeze status we want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns ''true'' if the vehicle is frozen, ''false'' if it isn't or if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example binds the &amp;quot;p&amp;quot; key to a function to freeze/unfreeze the player's current vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we store all players in a table&lt;br /&gt;
local connectedPlayers = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
-- for each one in it,&lt;br /&gt;
for i, aPlayer in ipairs(connectedPlayers) do&lt;br /&gt;
	-- bind the player's &amp;quot;p&amp;quot; key to the toggleFreezeStatus function&lt;br /&gt;
	bindKey ( aPlayer, &amp;quot;p&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;toggleFreezeStatus&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- this function freezes the specified player's vehicle, if he's in one&lt;br /&gt;
function toggleFreezeStatus ( thePlayer )&lt;br /&gt;
	-- if he is in a vehicle,&lt;br /&gt;
	if isPlayerInVehicle ( thePlayer ) then&lt;br /&gt;
		-- get the vehicle element&lt;br /&gt;
		local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
		-- get the current freeze status&lt;br /&gt;
		local currentFreezeStatus = isVehicleFrozen ( playerVehicle )&lt;br /&gt;
		-- get the new freeze status (the opposite of the previous)&lt;br /&gt;
		local newFreezeStatus = not currentFreezeStatus&lt;br /&gt;
		-- set the new freeze status&lt;br /&gt;
		setVehicleFrozen ( playerVehicle, newFreezeStatus )&lt;br /&gt;
	end&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FixVehicle&amp;diff=8193</id>
		<title>FixVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FixVehicle&amp;diff=8193"/>
		<updated>2007-05-06T22:32:58Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function will set a [[vehicle]]'s health to full and fix it's damage model. If you wish to just change the vehicle's health, without affecting it's damage model, use [[setVehicleHealth]].&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 fixVehicle ( vehicle theVehicle )             &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 fix&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle was fixed, ''false'' if ''theVehicle'' is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example fixes all the vehicles that exist in the map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Retrieve a table containing all the vehicles that exist&lt;br /&gt;
vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; )&lt;br /&gt;
-- Loop through the list, storing the vehicle from the table in the variable vehicleValue&lt;br /&gt;
for vehicleKey, vehicleValue in ipairs(blips) do&lt;br /&gt;
	-- fix the vehicle&lt;br /&gt;
	fixVehicle ( vehicleHealth )&lt;br /&gt;
end&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>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTimers&amp;diff=8192</id>
		<title>GetTimers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTimers&amp;diff=8192"/>
		<updated>2007-05-06T22:31:56Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns a table of all the timers (with the remaining time left below or equal to the time specified)&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 getTimers ( [ time ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''time:''' The maximum time left(ms) on the timers you wish to add to the table.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of all the active timers.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find and kill all the timers with less than 1 minute to go&lt;br /&gt;
timers = getTimers ( 60000 )&lt;br /&gt;
-- Loop through the timer list&lt;br /&gt;
for timerKey, timerValue in ipairs(timers) do&lt;br /&gt;
	-- kill the timer&lt;br /&gt;
        killTimer ( timerValue )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Split&amp;diff=8191</id>
		<title>Split</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Split&amp;diff=8191"/>
		<updated>2007-05-06T22:31:14Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function splits a string into sub-strings. You specify a character that will act as a separating character; this will determine where to split the sub-strings. For example, it can split the string &amp;quot;Hello World&amp;quot; into two strings containing the two words, by spliting using a space as a seperating character.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' You can use the function [[gettok]] to retrieve a single token from the string at a specific index. This may be faster for one-off lookups, but considerably slower if you are going to check each token in a long string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table split ( string stringToSplit, int separatingChar )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''stringToSplit''' The string you wish to split into parts.&lt;br /&gt;
* '''separatingChar''' The character you want to use to split (ASCII number)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of the sub-strings.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This examples takes any console text input and splits it into parts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onConsole ( player, text )&lt;br /&gt;
    splittext = split ( text, 32 ) -- Grab the table of tokens&lt;br /&gt;
    for splitKey, splitVal in ipairs(splittext) do -- for each token there..&lt;br /&gt;
        outputChatBox ( &amp;quot;key: &amp;quot; .. splitKey .. &amp;quot; val: &amp;quot; .. splitVal ) -- output the index and token&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayersInTeam&amp;diff=8190</id>
		<title>GetPlayersInTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayersInTeam&amp;diff=8190"/>
		<updated>2007-05-06T22:30:35Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is for retrieving all the players in the specified team.&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 getPlayersInTeam ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''theTeam:''' The team you wish to retrieve all the players from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of all the players in the team.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find and kill all the players in a team called &amp;quot;red&amp;quot;&lt;br /&gt;
redTeam = getTeamFromName ( &amp;quot;red&amp;quot; )&lt;br /&gt;
if ( redTeam ) then&lt;br /&gt;
  players = getPlayersInTeam ( redTeam )  &lt;br /&gt;
  -- Loop through the player table&lt;br /&gt;
  for playerKey, playerValue in ipairs(players) do&lt;br /&gt;
    -- kill the player&lt;br /&gt;
     killPlayer ( playerValue )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamFriendlyFire&amp;diff=8189</id>
		<title>GetTeamFriendlyFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamFriendlyFire&amp;diff=8189"/>
		<updated>2007-05-06T22:30:05Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the friendly fire value for the specified team.&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 getTeamFriendlyFire ( team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theTeam:''' The team that will be checked&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if friendly fire is on for the specified team, ''false'' if friendly fire is turned off for the specified team or if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks if friendly fire is on for every team, and toggles it on if it isn't.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--for every team,&lt;br /&gt;
for index, theTeam in ipairs(getElementsByType ( &amp;quot;team&amp;quot; )) do&lt;br /&gt;
	--if friendly fire is off,&lt;br /&gt;
	if ( getTeamFriendlyFire ( theTeam ) == false ) then&lt;br /&gt;
		--switch it on&lt;br /&gt;
		setTeamFriendlyFire ( theTeam, true )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBlipColor&amp;diff=8188</id>
		<title>GetBlipColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBlipColor&amp;diff=8188"/>
		<updated>2007-05-06T22:23:35Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function will tell you what color a blip is. This color is only applicable to the default blip icon. All other icons will ignore this.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int int int int getBlipColor ( blip theBlip )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBlip:''' The blip whos color you wish to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns four integers in RGBA format, with a maximum value of 255 for each.  Each stands for ''red'', ''green'', ''blue'', and ''alpha''.  Alpha decides transparancy where 255 is opaque and 0 is transparent.  ''false'' is returned if the blip is invalid. &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will find all the blips that exist and set them all to white if they aren't white already.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Retrieve a table containing all the blips that exist&lt;br /&gt;
blips = getElementsByType ( &amp;quot;blip&amp;quot; )&lt;br /&gt;
-- Loop through the list, storing the blip from the table in the variable blipValue&lt;br /&gt;
for blipKey, blipValue in ipairs(blips) do&lt;br /&gt;
	-- Retrieve the blip's colors into the variables red, green, blue and alpha&lt;br /&gt;
	red, green, blue, alpha = getBlipColor ( blipValue )&lt;br /&gt;
	-- If the blip's icon isn't white already&lt;br /&gt;
	if ( red ~= 255 or green ~= 255 or blue ~= 255 or alpha ~= 255 ) then&lt;br /&gt;
		-- Set the blip's color to white&lt;br /&gt;
		setBlipColor ( blipValue, 255, 255, 255, 255 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Blip_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBlipSize&amp;diff=8187</id>
		<title>GetBlipSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBlipSize&amp;diff=8187"/>
		<updated>2007-05-06T22:23:10Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function gets the size of a blip.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getBlipSize ( blip theBlip )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBlip:''' The blip you wish to get the size of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[int]] indicating the size of the blip. The default value is 2.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will reset the size of all blips to the default.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Retrieve a table containing all the blips that exist&lt;br /&gt;
blips = getElementsByType ( &amp;quot;blip&amp;quot; )&lt;br /&gt;
-- Loop through the list, storing the blip from the table in the variable blipValue&lt;br /&gt;
for blipKey, blipValue in ipairs(blips) do&lt;br /&gt;
	-- Retrieve the blip's size into the variable 'blipSize'&lt;br /&gt;
	blipSize = getBlipSize ( blipValue )&lt;br /&gt;
	-- If the blip's size wasn't 2 (the default size) already&lt;br /&gt;
	if ( blipSize ~= 2 ) then&lt;br /&gt;
		-- Set the blip's icon to the default&lt;br /&gt;
		setBlipSize ( blipValue, 2 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Blip_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBlipIcon&amp;diff=8186</id>
		<title>GetBlipIcon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBlipIcon&amp;diff=8186"/>
		<updated>2007-05-06T22:22:38Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the icon a blip currently has.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getBlipIcon ( blip theBlip )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theBlip''': the blip we're getting the icon number of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[int]] indicating which icon the blip has. Valid values are:&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will find all the blips that exist and set them all to the default blip icon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Retrieve a table containing all the blips that exist&lt;br /&gt;
blips = getElementsByType ( &amp;quot;blip&amp;quot; )&lt;br /&gt;
-- Loop through the list, storing the blip from the table in the variable blipValue&lt;br /&gt;
for blipKey, blipValue in ipairs(blips) do&lt;br /&gt;
	-- Retrieve the blip's icon into the variable 'blipIcon'&lt;br /&gt;
	blipIcon = getBlipIcon ( blipValue )&lt;br /&gt;
	-- If the blip's icon wasn't the default already&lt;br /&gt;
	if ( blipIcon ~= 0 ) then&lt;br /&gt;
		-- Set the blip's icon to the default&lt;br /&gt;
		setBlipIcon ( blipValue, 0 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Blip_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=8185</id>
		<title>GetThisResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetThisResource&amp;diff=8185"/>
		<updated>2007-05-06T22:20:04Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function retrieves the resource from which the function call was made.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource getThisResource ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the resource in which the current script is.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getRootElement(), &amp;quot;onStartInScoresResource&amp;quot;)&lt;br /&gt;
function onStartInScoresResource(resource)&lt;br /&gt;
     local thisResource = getThisResource() -- get the resource that this script is a part of&lt;br /&gt;
     if (resource == thisResource) then -- make sure the resource that started is the one this script is a part of&lt;br /&gt;
          -- Note: without this check, the operations below would execute whenever ANY resource is loaded&lt;br /&gt;
          -- perform some operations this script will be used for, in this case keeping track of player scores and money:&lt;br /&gt;
          local players = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
          for playerKey, playerValue in ipairs(players) do&lt;br /&gt;
               setPlayerMoney(playerValue, 500)&lt;br /&gt;
               setElementData(playerValue, &amp;quot;score&amp;quot;, 0)&lt;br /&gt;
          end&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;br /&gt;
[[Category:Needs_Checking]]&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=8184</id>
		<title>RestartResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RestartResource&amp;diff=8184"/>
		<updated>2007-05-06T22:19:30Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function restarts a running resource.&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 restartResource ( resource theResource )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the [[resource]] we want to restart.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource was restarted, ''false'' if the restart failed, or an invalid resource was passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This function restarts all running resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function restartAllResources()&lt;br /&gt;
	--we store a table of resources&lt;br /&gt;
	local allResources = getResources()&lt;br /&gt;
	--for each one of them,&lt;br /&gt;
	for index, resource in ipairs(allResources) do&lt;br /&gt;
		--if it's running,&lt;br /&gt;
		if getResourceState(resource) == &amp;quot;running&amp;quot; then&lt;br /&gt;
			--then restart it&lt;br /&gt;
			restartResource(resource)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResources&amp;diff=8183</id>
		<title>GetResources</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResources&amp;diff=8183"/>
		<updated>2007-05-06T22:18:24Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function retrieves a table of all the resources that exist on the server.&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 getResources ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of resources.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function displayResources()&lt;br /&gt;
     outputConsole(&amp;quot;List of resources:&amp;quot;)&lt;br /&gt;
     local resourceTable = getResources() -- get a table of resources&lt;br /&gt;
     for resourceKey, resourceValue in ipairs(resourceTable) do&lt;br /&gt;
          -- iterate through the table and output each resource's name&lt;br /&gt;
          local name = getResourceName(resourceValue)&lt;br /&gt;
          outputConsole(&amp;quot; &amp;quot; .. name)&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopResource&amp;diff=8182</id>
		<title>StopResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopResource&amp;diff=8182"/>
		<updated>2007-05-06T22:17:32Z</updated>

		<summary type="html">&lt;p&gt;VRocker2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function stops a running resource.&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 stopResource ( resource theResource )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the [[resource]] we want to stop.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource was stopped, ''false'' if the stopping failed, or an invalid resource was passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This function stops all running resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopAllResources()&lt;br /&gt;
	--we store a table of resources&lt;br /&gt;
	local allResources = getResources()&lt;br /&gt;
	--for each one of them,&lt;br /&gt;
	for index, resource in ipairs(allResources) do&lt;br /&gt;
		--if it's running,&lt;br /&gt;
		if getResourceState(resource) == &amp;quot;running&amp;quot; then&lt;br /&gt;
			--then stop it&lt;br /&gt;
			stopResource(resource)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>VRocker2</name></author>
	</entry>
</feed>