<?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=Driver2</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=Driver2"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Driver2"/>
	<updated>2026-04-24T06:45:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=22522</id>
		<title>Resource:Race</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=22522"/>
		<updated>2010-03-02T21:44:02Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Events for version 0.8.3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The &amp;quot;race&amp;quot; gamemode organizes sprint or freeroam races for one or more players. It supports both maps from MTA:Race and maps in the MTA:SA DM map syntax that were created in the map editor.&lt;br /&gt;
&lt;br /&gt;
==Ingame==&lt;br /&gt;
Playing race is quite straightforward. If there are checkpoints, drive from checkpoint to checkpoint and be the first to reach the finish line within the time. If there are no checkpoints, just drive around and have fun.&lt;br /&gt;
&lt;br /&gt;
In races you may encounter three types of pickups which will have an effect on your vehicle:&lt;br /&gt;
*'''Repair pickups:''' this pickup looks like a wrench. If you drive over it, your vehicle will be restored to full health.&lt;br /&gt;
*'''Nitrous oxide pickups:''' a red NOS bottle. After you drive over one you can press the fire button (by default the left mouse button) to get a temporary speed boost.&lt;br /&gt;
*'''Vehicle change pickups:''' these display the name of a vehicle above them. As soon as you drive over a pickup your vehicle will be changed.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you get stuck during a race, you can enter the /kill command in the chatbox to kill yourself and respawn at the previous checkpoint.&lt;br /&gt;
&lt;br /&gt;
==Converting MTA:Race maps==&lt;br /&gt;
Use the [http://files.mtasa.com/apps/1.0/raceconv.zip batch converter] to convert all your MTA:Race maps into MTA:SA maps in one go.&lt;br /&gt;
&lt;br /&gt;
==Map syntax==&lt;br /&gt;
You can create race maps using the new MTA:SA [[Resource:editor|map editor]]. The map syntax is given here for reference.&lt;br /&gt;
&lt;br /&gt;
===.map file===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;deathmatch&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotation=&amp;quot;Rotation in degrees&amp;quot; vehicle=&amp;quot;Vehicle ID&amp;quot; id=&amp;quot;spawnpointID&amp;quot; [ paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; color=&amp;quot;#FF0000&amp;quot; id=&amp;quot;textual or numeric checkpoint ID&amp;quot; nextid=&amp;quot;ID of checkpoint after this one&amp;quot; [ size=&amp;quot;checkpoint size&amp;quot; vehicle=&amp;quot;vehicle ID to change into&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotX=&amp;quot;in degrees&amp;quot; rotY=&amp;quot;in degrees&amp;quot; rotZ=&amp;quot;in degrees&amp;quot; model=&amp;quot;model ID&amp;quot; id=&amp;quot;objectID&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; type=&amp;quot;repair|nitro|vehiclechange&amp;quot; id=&amp;quot;pickupID&amp;quot; [ vehicle=&amp;quot;vehicle ID&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===meta.xml===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;Map name&amp;quot; author=&amp;quot;Author name&amp;quot; description=&amp;quot;Map description&amp;quot; version=&amp;quot;Map version number&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;race src=&amp;quot;Map file.map&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;settings&amp;gt;&lt;br /&gt;
      &amp;lt;setting name=&amp;quot;#optionName&amp;quot; value=&amp;quot;optionValue&amp;quot;/&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
   &amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;setting&amp;gt;s correspond to options in MTA:Race syntax. For example, &amp;lt;time&amp;gt;4:0&amp;lt;/time&amp;gt; in MTA:Race syntax would correspond to &amp;lt;setting name=&amp;quot;#time&amp;quot; value=&amp;quot;4:0&amp;quot;/&amp;gt; in DM syntax.&lt;br /&gt;
&lt;br /&gt;
==Addons==&lt;br /&gt;
A Race 'addon' is no different from any other script resource, except that is has addon=&amp;quot;race&amp;quot; in the &amp;lt;info&amp;gt; section of it's meta.xml file. This is simply to allow Race to identify it and put it in the /config menu for you. Addons communicate with Race via events. The current list of Race events and what they do are here:&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3==&lt;br /&gt;
'''Note:''' You may have to add the events in your script using addEvent() if you want to use them.&lt;br /&gt;
===Server===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''Name'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|'''Source'''&lt;br /&gt;
|'''Parameters'''	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerReachCheckpoint'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint, int time_&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerPickUpRacePickup'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID, string pickupType, int vehicleModel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-		&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onMapStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table mapInfo, table mapOptions, table gameOptions&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerFinish'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;20pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int rank, int time&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPostFinish'''	&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPollStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table poll&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onRaceStateChanging'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string newStateName, string oldStateName&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerRaceWasted'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle playersVehicle&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Client===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientMapStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table mapinfo&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientPlayerFinish'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientPlayerOutOfTime'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientMapStopping'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientScreenFadedOut'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientScreenFadedIn'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3 in detail==&lt;br /&gt;
'''Note:''' You may have to add the events in your script using addEvent() if you want to use them.&lt;br /&gt;
===onPlayerReachCheckpoint===&lt;br /&gt;
Triggered when a player reaches any checkpoint but the last one.&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint, int time&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''checkpoint:''' the number of the checkpoint the player went through. The first checkpoint has number 1.&lt;br /&gt;
*'''time:''' time since the race started, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that reached the checkpoint.&lt;br /&gt;
&lt;br /&gt;
===onPlayerFinish===&lt;br /&gt;
Triggered when a player reaches the last checkpoint (i.e. has finished the race)&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int rank, int time&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''rank:''' the player's rank. 1 means he won the race, 2 that he came in second place, etc.&lt;br /&gt;
*'''time:''' time since the race started, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that finished the race.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickUpRacePickup===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID, string pickupType, int vehicleModel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''pickupID:''' the number of the pickup in case of MTA:Race syntax (starting at 1), or the &amp;quot;id&amp;quot; attribute of the pickup in case of DM syntax.&lt;br /&gt;
*'''pickupType:''' the pickup type. Can be &amp;quot;nitro&amp;quot;, &amp;quot;repair&amp;quot; or &amp;quot;vehiclechange&amp;quot;.&lt;br /&gt;
*'''vehicleModel:''' if the pickup is of type vehiclechange, this is the vehicle model that it sets.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that picked up the pickup.&lt;br /&gt;
&lt;br /&gt;
==Element data==&lt;br /&gt;
These element data are set on each player:&lt;br /&gt;
*'''Race rank:''' the current position of the player in the race. 1 = first, 2 = second etc. Updated on a 1 second interval.&lt;br /&gt;
*'''race.checkpoint:''' the number of the checkpoint the player is ''heading for''. When the player spawns this number is 1, after he passed the first checkpoint it's 2, etc.&lt;br /&gt;
*'''race.finished:''' ''true'' if the player has finished, ''false'' if he's still racing.&lt;br /&gt;
&lt;br /&gt;
This server only element data is set for the resource root element:&lt;br /&gt;
*'''info:''' which contains a table with these sub-tables: '''mapInfo''', '''mapOptions''' and '''gameOptions'''.&lt;br /&gt;
&lt;br /&gt;
==Super Advanced Element data==&lt;br /&gt;
You can also set player element data to change the player collision status and render transparency:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
e.g. setElementData( thePlayer, &amp;quot;overrideCollide.uniqueblah&amp;quot;, 0, false )		-- Collide 'off' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideCollide.uniqueblah&amp;quot;, nil, false )		-- Collide 'default' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideAlpha.uniqueblah&amp;quot;, 120, false )		-- Alpha '120 maximum' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideAlpha.uniqueblah&amp;quot;, nil, false )		-- Alpha 'default' for this player&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Set 'uniqueblah' to whatever you like (up to 15 characters long)&lt;br /&gt;
&lt;br /&gt;
==Exported Server functions==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getTimePassed'''&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getPlayerRank'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''isPlayerFinished'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getPlayerVehicle'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=22495</id>
		<title>Resource:Race</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=22495"/>
		<updated>2010-02-26T03:18:42Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Events for version 0.8.3 in detail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The &amp;quot;race&amp;quot; gamemode organizes sprint or freeroam races for one or more players. It supports both maps from MTA:Race and maps in the MTA:SA DM map syntax that were created in the map editor.&lt;br /&gt;
&lt;br /&gt;
==Ingame==&lt;br /&gt;
Playing race is quite straightforward. If there are checkpoints, drive from checkpoint to checkpoint and be the first to reach the finish line within the time. If there are no checkpoints, just drive around and have fun.&lt;br /&gt;
&lt;br /&gt;
In races you may encounter three types of pickups which will have an effect on your vehicle:&lt;br /&gt;
*'''Repair pickups:''' this pickup looks like a wrench. If you drive over it, your vehicle will be restored to full health.&lt;br /&gt;
*'''Nitrous oxide pickups:''' a red NOS bottle. After you drive over one you can press the fire button (by default the left mouse button) to get a temporary speed boost.&lt;br /&gt;
*'''Vehicle change pickups:''' these display the name of a vehicle above them. As soon as you drive over a pickup your vehicle will be changed.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you get stuck during a race, you can enter the /kill command in the chatbox to kill yourself and respawn at the previous checkpoint.&lt;br /&gt;
&lt;br /&gt;
==Converting MTA:Race maps==&lt;br /&gt;
Use the [http://files.mtasa.com/apps/1.0/raceconv.zip batch converter] to convert all your MTA:Race maps into MTA:SA maps in one go.&lt;br /&gt;
&lt;br /&gt;
==Map syntax==&lt;br /&gt;
You can create race maps using the new MTA:SA [[Resource:editor|map editor]]. The map syntax is given here for reference.&lt;br /&gt;
&lt;br /&gt;
===.map file===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;deathmatch&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotation=&amp;quot;Rotation in degrees&amp;quot; vehicle=&amp;quot;Vehicle ID&amp;quot; id=&amp;quot;spawnpointID&amp;quot; [ paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; color=&amp;quot;#FF0000&amp;quot; id=&amp;quot;textual or numeric checkpoint ID&amp;quot; nextid=&amp;quot;ID of checkpoint after this one&amp;quot; [ size=&amp;quot;checkpoint size&amp;quot; vehicle=&amp;quot;vehicle ID to change into&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotX=&amp;quot;in degrees&amp;quot; rotY=&amp;quot;in degrees&amp;quot; rotZ=&amp;quot;in degrees&amp;quot; model=&amp;quot;model ID&amp;quot; id=&amp;quot;objectID&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; type=&amp;quot;repair|nitro|vehiclechange&amp;quot; id=&amp;quot;pickupID&amp;quot; [ vehicle=&amp;quot;vehicle ID&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===meta.xml===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;Map name&amp;quot; author=&amp;quot;Author name&amp;quot; description=&amp;quot;Map description&amp;quot; version=&amp;quot;Map version number&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;race src=&amp;quot;Map file.map&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;settings&amp;gt;&lt;br /&gt;
      &amp;lt;setting name=&amp;quot;#optionName&amp;quot; value=&amp;quot;optionValue&amp;quot;/&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
   &amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;setting&amp;gt;s correspond to options in MTA:Race syntax. For example, &amp;lt;time&amp;gt;4:0&amp;lt;/time&amp;gt; in MTA:Race syntax would correspond to &amp;lt;setting name=&amp;quot;#time&amp;quot; value=&amp;quot;4:0&amp;quot;/&amp;gt; in DM syntax.&lt;br /&gt;
&lt;br /&gt;
==Addons==&lt;br /&gt;
A Race 'addon' is no different from any other script resource, except that is has addon=&amp;quot;race&amp;quot; in the &amp;lt;info&amp;gt; section of it's meta.xml file. This is simply to allow Race to identify it and put it in the /config menu for you. Addons communicate with Race via events. The current list of Race events and what they do are here:&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3==&lt;br /&gt;
&lt;br /&gt;
===Server===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''Name'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|'''Source'''&lt;br /&gt;
|'''Parameters'''	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerReachCheckpoint'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint, int time_&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerPickUpRacePickup'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID, string pickupType, int vehicleModel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-		&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onMapStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table mapInfo, table mapOptions, table gameOptions&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerFinish'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;20pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int rank, int time&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPostFinish'''	&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPollStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table poll&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onRaceStateChanging'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string newStateName, string oldStateName&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onPlayerRaceWasted'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle playersVehicle&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Client===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientMapStarting'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table mapinfo&amp;lt;/syntaxhighlight&amp;gt;	&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientPlayerFinish'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientPlayerOutOfTime'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|player	&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientMapStopping'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientScreenFadedOut'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;200pt&amp;quot;|'''onClientScreenFadedIn'''&lt;br /&gt;
|width=&amp;quot;60pt&amp;quot;|&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3 in detail==&lt;br /&gt;
'''Note:''' You may have to add the events in your script using addEvent() if you want to use them.&lt;br /&gt;
===onPlayerReachCheckpoint===&lt;br /&gt;
Triggered when a player reaches any checkpoint but the last one.&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint, int time&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''checkpoint:''' the number of the checkpoint the player went through. The first checkpoint has number 1.&lt;br /&gt;
*'''time:''' time since the race started, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that reached the checkpoint.&lt;br /&gt;
&lt;br /&gt;
===onPlayerFinish===&lt;br /&gt;
Triggered when a player reaches the last checkpoint (i.e. has finished the race)&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int rank, int time&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''rank:''' the player's rank. 1 means he won the race, 2 that he came in second place, etc.&lt;br /&gt;
*'''time:''' time since the race started, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that finished the race.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickUpRacePickup===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID, string pickupType, int vehicleModel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''pickupID:''' the number of the pickup in case of MTA:Race syntax (starting at 1), or the &amp;quot;id&amp;quot; attribute of the pickup in case of DM syntax.&lt;br /&gt;
*'''pickupType:''' the pickup type. Can be &amp;quot;nitro&amp;quot;, &amp;quot;repair&amp;quot; or &amp;quot;vehiclechange&amp;quot;.&lt;br /&gt;
*'''vehicleModel:''' if the pickup is of type vehiclechange, this is the vehicle model that it sets.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that picked up the pickup.&lt;br /&gt;
&lt;br /&gt;
==Element data==&lt;br /&gt;
These element data are set on each player:&lt;br /&gt;
*'''Race rank:''' the current position of the player in the race. 1 = first, 2 = second etc. Updated on a 1 second interval.&lt;br /&gt;
*'''race.checkpoint:''' the number of the checkpoint the player is ''heading for''. When the player spawns this number is 1, after he passed the first checkpoint it's 2, etc.&lt;br /&gt;
*'''race.finished:''' ''true'' if the player has finished, ''false'' if he's still racing.&lt;br /&gt;
&lt;br /&gt;
This server only element data is set for the resource root element:&lt;br /&gt;
*'''info:''' which contains a table with these sub-tables: '''mapInfo''', '''mapOptions''' and '''gameOptions'''.&lt;br /&gt;
&lt;br /&gt;
==Super Advanced Element data==&lt;br /&gt;
You can also set player element data to change the player collision status and render transparency:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
e.g. setElementData( thePlayer, &amp;quot;overrideCollide.uniqueblah&amp;quot;, 0, false )		-- Collide 'off' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideCollide.uniqueblah&amp;quot;, nil, false )		-- Collide 'default' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideAlpha.uniqueblah&amp;quot;, 120, false )		-- Alpha '120 maximum' for this player&lt;br /&gt;
     setElementData( thePlayer, &amp;quot;overrideAlpha.uniqueblah&amp;quot;, nil, false )		-- Alpha 'default' for this player&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Set 'uniqueblah' to whatever you like (up to 15 characters long)&lt;br /&gt;
&lt;br /&gt;
==Exported Server functions==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getTimePassed'''&lt;br /&gt;
|height=&amp;quot;38pt&amp;quot;|&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getPlayerRank'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''isPlayerFinished'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-	&lt;br /&gt;
|width=&amp;quot;80pt&amp;quot;|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|width=&amp;quot;110pt&amp;quot;|'''getPlayerVehicle'''&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player thePlayer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-	&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=21834</id>
		<title>Var dump</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=21834"/>
		<updated>2009-11-05T20:53:40Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;var_dump&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function outputs information about one or more variables using outputConsole().&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string/table var_dump( ... )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
The function can have a variable number of arguments. Those arguments can be of three types:&lt;br /&gt;
* '''Modifiers:''' A ''string'' that begins with a &amp;quot;-&amp;quot; (minus) and that is followed by at least another parameter is a modifier. A modifier can change the behaviour of the function. Modifiers don't have to be the first argument, they always work on all arguments after it (see examples).&lt;br /&gt;
* '''Names:''' A ''string'' that is followed by at least another parameter and isn't preceeded by another ''string'' (that is not a modifier), is a name. A name is output before the variable output, to make it recognizable (basicially a description of the variable that is being output, e.g. the name).&lt;br /&gt;
* '''Values:''' Any value that is not one of the two above will generate an output with information about the variable:&lt;br /&gt;
** For ''strings'': string(''lengthOfString'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''userdata'': userdata(''MTA element type'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''tables'': table(''numerOfElements'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
*** If the table contains any elements, they will also be output if the appropriate modifiers are set. This will always be in the form [''key''] =&amp;gt; ''value'', while ''key'' and ''value'' are formatted by var_dump.&lt;br /&gt;
&lt;br /&gt;
===Modifiers===&lt;br /&gt;
* '''v''' (verbose): Dumps more data than usual (for now it outputs whole tables including subtables)&lt;br /&gt;
* '''n''' (normal): Switches back into 'normal' non-verbose mode.&lt;br /&gt;
* '''s''' (silent): With this activated, it outputs nothing at all, however it still returns the output, so you can use it yourself (also used internally for recursion).&lt;br /&gt;
* '''u''' (unnamed): Don't use names. Every ''string'' that is not a modifier will be output as a value, not a decription.&lt;br /&gt;
* '''d[number]''' (depth): Output nested tables up to this depth (e.g. &amp;quot;d1&amp;quot; means output all values of the initial table, but not the values of the values, if they are also tables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string with all the output in one line and a table with several lines of output.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- modifiers: v - verbose (all subtables), n - normal, s - silent (no output), dx - up to depth x, u - unnamed&lt;br /&gt;
function var_dump(...)&lt;br /&gt;
	-- default options&lt;br /&gt;
	local verbose = false&lt;br /&gt;
	local firstLevel = true&lt;br /&gt;
	local outputDirectly = true&lt;br /&gt;
	local noNames = false&lt;br /&gt;
	local indentation = &amp;quot;\t\t\t\t\t\t&amp;quot;&lt;br /&gt;
	local depth = nil&lt;br /&gt;
&lt;br /&gt;
	local name = nil&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		-- check for modifiers&lt;br /&gt;
		if type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and v:sub(1,1) == &amp;quot;-&amp;quot; then&lt;br /&gt;
			local modifiers = v:sub(2)&lt;br /&gt;
			if modifiers:find(&amp;quot;v&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = true&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;s&amp;quot;) ~= nil then&lt;br /&gt;
				outputDirectly = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;n&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;u&amp;quot;) ~= nil then&lt;br /&gt;
				noNames = true&lt;br /&gt;
			end&lt;br /&gt;
			local s,e = modifiers:find(&amp;quot;d%d+&amp;quot;)&lt;br /&gt;
			if s ~= nil then&lt;br /&gt;
				depth = tonumber(string.sub(modifiers,s+1,e))&lt;br /&gt;
			end&lt;br /&gt;
		-- set name if appropriate&lt;br /&gt;
		elseif type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and name == nil and not noNames then&lt;br /&gt;
			name = v&lt;br /&gt;
		else&lt;br /&gt;
			if name ~= nil then&lt;br /&gt;
				name = &amp;quot;&amp;quot;..name..&amp;quot;: &amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				name = &amp;quot;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			local o = &amp;quot;&amp;quot;&lt;br /&gt;
			if type(v) == &amp;quot;string&amp;quot; then&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..v:len()..&amp;quot;) \&amp;quot;&amp;quot;..v..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;userdata&amp;quot; then&lt;br /&gt;
				local elementType = &amp;quot;no valid MTA element&amp;quot;&lt;br /&gt;
				if isElement(v) then&lt;br /&gt;
					elementType = getElementType(v)&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..elementType..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;table&amp;quot; then&lt;br /&gt;
				local count = 0&lt;br /&gt;
				for key,value in pairs(v) do&lt;br /&gt;
					count = count + 1&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..count..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
				if verbose and count &amp;gt; 0 and (depth == nil or depth &amp;gt; 0) then&lt;br /&gt;
					table.insert(output,&amp;quot;\t{&amp;quot;)&lt;br /&gt;
					for key,value in pairs(v) do&lt;br /&gt;
						-- calls itself, so be careful when you change anything&lt;br /&gt;
						local newModifiers = &amp;quot;-s&amp;quot;&lt;br /&gt;
						if depth == nil then&lt;br /&gt;
							newModifiers = &amp;quot;-sv&amp;quot;&lt;br /&gt;
						elseif  depth &amp;gt; 1 then&lt;br /&gt;
							local newDepth = depth - 1&lt;br /&gt;
							newModifiers = &amp;quot;-svd&amp;quot;..newDepth&lt;br /&gt;
						end&lt;br /&gt;
						local keyString, keyTable = var_dump(newModifiers,key)&lt;br /&gt;
						local valueString, valueTable = var_dump(newModifiers,value)&lt;br /&gt;
						&lt;br /&gt;
						if #keyTable == 1 and #valueTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						elseif #keyTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;&amp;quot;)&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								table.insert(output,indentation..v)&lt;br /&gt;
							end&lt;br /&gt;
						elseif #valueTable == 1 then&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						else&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot; =&amp;gt; &amp;quot;..v)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					table.insert(output,&amp;quot;\t}&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot; \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			name = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local string = &amp;quot;&amp;quot;&lt;br /&gt;
	for k,v in ipairs(output) do&lt;br /&gt;
		if outputDirectly then&lt;br /&gt;
			outputConsole(v)&lt;br /&gt;
		end&lt;br /&gt;
		string = string..v&lt;br /&gt;
	end&lt;br /&gt;
	return string, output&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Get a table of all players on the server (if there are 4 players).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(getElementsByType(&amp;quot;player&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(4) &amp;quot;table: 02998058&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
With 'verbose' modifier.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 043C6900&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now another table we created before (please not that the table 'test2' is both key and value in this example):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 020B7838&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 021770A0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }]&lt;br /&gt;
       =&amp;gt; table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table 'normal':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-n&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 01BB9030&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 0223B2D8&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table only to depth 1 (the verbose is still active from the first argument):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 029BE6E8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 01E2CDF8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 021C6378&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 021C6378&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with names to make clear which output belongs to which variable (of course in this small example, it's not really needed):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,&amp;quot;test tables&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
players: table(1) &amp;quot;table: 0219F4D0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
test tables: table(2) &amp;quot;table: 0219DB20&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 01B68048&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 01B68048&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now 'unnamed', meaning all values that are not modifiers will be output as values. However, the last two arguments were also removed, which leaves the last modifier as last argument, which will output the modifier as a normal value:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-u&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string(7) &amp;quot;players&amp;quot;&lt;br /&gt;
table(1) &amp;quot;table: 028B8A10&amp;quot;&lt;br /&gt;
string(3) &amp;quot;-d1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=21833</id>
		<title>Var dump</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=21833"/>
		<updated>2009-11-05T20:51:49Z</updated>

		<summary type="html">&lt;p&gt;Driver2: Created page with '{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;var_dump&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function outputs information about one or more variables.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string/table var_d…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;var_dump&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function outputs information about one or more variables.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string/table var_dump( ... )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
The function can have a variable number of arguments. Those arguments can be of three types:&lt;br /&gt;
* '''Modifiers:''' A ''string'' that begins with a &amp;quot;-&amp;quot; (minus) and that is followed by at least another parameter is a modifier. A modifier can change the behaviour of the function. Modifiers don't have to be the first argument, they always work on all arguments after it (see examples).&lt;br /&gt;
* '''Names:''' A ''string'' that is followed by at least another parameter and isn't preceeded by another ''string'' (that is not a modifier), is a name. A name is output before the variable output, to make it recognizable (basicially a description of the variable that is being output, e.g. the name).&lt;br /&gt;
* '''Values:''' Any value that is not one of the two above will generate an output with information about the variable:&lt;br /&gt;
** For ''strings'': string(''lengthOfString'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''userdata'': userdata(''MTA element type'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''tables'': table(''numerOfElements'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
*** If the table contains any elements, they will also be output if the appropriate modifiers are set. This will always be in the form [''key''] =&amp;gt; ''value'', while ''key'' and ''value'' are formatted by var_dump.&lt;br /&gt;
&lt;br /&gt;
===Modifiers===&lt;br /&gt;
* '''v''' (verbose): Dumps more data than usual (for now it outputs whole tables including subtables)&lt;br /&gt;
* '''n''' (normal): Switches back into 'normal' non-verbose mode.&lt;br /&gt;
* '''s''' (silent): With this activated, it outputs nothing at all, however it still returns the output, so you can use it yourself (also used internally for recursion).&lt;br /&gt;
* '''u''' (unnamed): Don't use names. Every ''string'' that is not a modifier will be output as a value, not a decription.&lt;br /&gt;
* '''d[number]''' (depth): Output nested tables up to this depth (e.g. &amp;quot;d1&amp;quot; means output all values of the initial table, but not the values of the values, if they are also tables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string with all the output in one line and a table with several lines of output.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- modifiers: v - verbose (all subtables), n - normal, s - silent (no output), dx - up to depth x, u - unnamed&lt;br /&gt;
function var_dump(...)&lt;br /&gt;
	-- default options&lt;br /&gt;
	local verbose = false&lt;br /&gt;
	local firstLevel = true&lt;br /&gt;
	local outputDirectly = true&lt;br /&gt;
	local noNames = false&lt;br /&gt;
	local indentation = &amp;quot;\t\t\t\t\t\t&amp;quot;&lt;br /&gt;
	local depth = nil&lt;br /&gt;
&lt;br /&gt;
	local name = nil&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		-- check for modifiers&lt;br /&gt;
		if type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and v:sub(1,1) == &amp;quot;-&amp;quot; then&lt;br /&gt;
			local modifiers = v:sub(2)&lt;br /&gt;
			if modifiers:find(&amp;quot;v&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = true&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;s&amp;quot;) ~= nil then&lt;br /&gt;
				outputDirectly = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;n&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;u&amp;quot;) ~= nil then&lt;br /&gt;
				noNames = true&lt;br /&gt;
			end&lt;br /&gt;
			local s,e = modifiers:find(&amp;quot;d%d+&amp;quot;)&lt;br /&gt;
			if s ~= nil then&lt;br /&gt;
				depth = tonumber(string.sub(modifiers,s+1,e))&lt;br /&gt;
			end&lt;br /&gt;
		-- set name if appropriate&lt;br /&gt;
		elseif type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and name == nil and not noNames then&lt;br /&gt;
			name = v&lt;br /&gt;
		else&lt;br /&gt;
			if name ~= nil then&lt;br /&gt;
				name = &amp;quot;&amp;quot;..name..&amp;quot;: &amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				name = &amp;quot;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			local o = &amp;quot;&amp;quot;&lt;br /&gt;
			if type(v) == &amp;quot;string&amp;quot; then&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..v:len()..&amp;quot;) \&amp;quot;&amp;quot;..v..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;userdata&amp;quot; then&lt;br /&gt;
				local elementType = &amp;quot;no valid MTA element&amp;quot;&lt;br /&gt;
				if isElement(v) then&lt;br /&gt;
					elementType = getElementType(v)&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..elementType..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;table&amp;quot; then&lt;br /&gt;
				local count = 0&lt;br /&gt;
				for key,value in pairs(v) do&lt;br /&gt;
					count = count + 1&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..count..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
				if verbose and count &amp;gt; 0 and (depth == nil or depth &amp;gt; 0) then&lt;br /&gt;
					table.insert(output,&amp;quot;\t{&amp;quot;)&lt;br /&gt;
					for key,value in pairs(v) do&lt;br /&gt;
						-- calls itself, so be careful when you change anything&lt;br /&gt;
						local newModifiers = &amp;quot;-s&amp;quot;&lt;br /&gt;
						if depth == nil then&lt;br /&gt;
							newModifiers = &amp;quot;-sv&amp;quot;&lt;br /&gt;
						elseif  depth &amp;gt; 1 then&lt;br /&gt;
							local newDepth = depth - 1&lt;br /&gt;
							newModifiers = &amp;quot;-svd&amp;quot;..newDepth&lt;br /&gt;
						end&lt;br /&gt;
						local keyString, keyTable = var_dump(newModifiers,key)&lt;br /&gt;
						local valueString, valueTable = var_dump(newModifiers,value)&lt;br /&gt;
						&lt;br /&gt;
						if #keyTable == 1 and #valueTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						elseif #keyTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;&amp;quot;)&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								table.insert(output,indentation..v)&lt;br /&gt;
							end&lt;br /&gt;
						elseif #valueTable == 1 then&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						else&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot; =&amp;gt; &amp;quot;..v)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					table.insert(output,&amp;quot;\t}&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot; \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			name = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local string = &amp;quot;&amp;quot;&lt;br /&gt;
	for k,v in ipairs(output) do&lt;br /&gt;
		if outputDirectly then&lt;br /&gt;
			outputConsole(v)&lt;br /&gt;
		end&lt;br /&gt;
		string = string..v&lt;br /&gt;
	end&lt;br /&gt;
	return string, output&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Get a table of all players on the server (if there are 4 players).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(getElementsByType(&amp;quot;player&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(4) &amp;quot;table: 02998058&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
With 'verbose' modifier.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 043C6900&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now another table we created before (please not that the table 'test2' is both key and value in this example):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 020B7838&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 021770A0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }]&lt;br /&gt;
       =&amp;gt; table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table 'normal':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-n&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 01BB9030&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 0223B2D8&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table only to depth 1 (the verbose is still active from the first argument):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 029BE6E8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 01E2CDF8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 021C6378&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 021C6378&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with names to make clear which output belongs to which variable (of course in this small example, it's not really needed):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,&amp;quot;test tables&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
players: table(1) &amp;quot;table: 0219F4D0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
test tables: table(2) &amp;quot;table: 0219DB20&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 01B68048&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 01B68048&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now 'unnamed', meaning all values that are not modifiers will be output as values. However, the last two arguments were also removed, which leaves the last modifier as last argument, which will output the modifier as a normal value:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-u&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string(7) &amp;quot;players&amp;quot;&lt;br /&gt;
table(1) &amp;quot;table: 028B8A10&amp;quot;&lt;br /&gt;
string(3) &amp;quot;-d1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14714</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14714"/>
		<updated>2008-01-11T21:49:29Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
'''(as of version 1.1)'''&lt;br /&gt;
&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory.&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
'''(as of version 1.1, in version 1.0 only some settings can be set in the meta.xml)'''&lt;br /&gt;
&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
''none''&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' Specifies the objective (id) that has to be reached by the attackers in order to finish the round. If left empty, all objectives have to be reached.&lt;br /&gt;
* '''finishType:''' You ''can'' specify the '''finishType''' in addition to the '''finishObjective''' (''in version 1.0 this is required'')&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element (version 1.0)&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14712</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14712"/>
		<updated>2008-01-11T21:44:43Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Required Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
'''(as of version 1.1)'''&lt;br /&gt;
&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory.&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
'''(as of version 1.1, in version 1.0 only some settings can be set in the meta.xml)'''&lt;br /&gt;
&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
''none''&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element (version 1.0)&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14579</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14579"/>
		<updated>2008-01-06T18:05:37Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Map Elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
'''(as of version 1.1)'''&lt;br /&gt;
&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory.&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
'''(as of version 1.1, in version 1.0 only some settings can be set in the meta.xml)'''&lt;br /&gt;
&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element (version 1.0)&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14578</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14578"/>
		<updated>2008-01-06T18:03:18Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* General Map Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
'''(as of version 1.1)'''&lt;br /&gt;
&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
'''(as of version 1.1, in version 1.0 only some settings can be set in the meta.xml)'''&lt;br /&gt;
&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element (version 1.0)&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14577</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14577"/>
		<updated>2008-01-06T18:01:54Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* General Assault Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
'''(as of version 1.1)'''&lt;br /&gt;
&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14573</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14573"/>
		<updated>2008-01-06T16:23:22Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* General Assault Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
* '''teamBalance''': Defines how many more players can be in either team respectively. For example when you set it to '1' while Team Blue has 2 players and Team Red has 1 player, new players couldn't join Team Blue. If you had set it to '2' in the same situtation, one more player could join Team Blue. (''default: 1'')&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14572</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14572"/>
		<updated>2008-01-06T16:15:38Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Assault Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=General Assault Settings=&lt;br /&gt;
These settings can be specified in Assault's ''meta.xml'' [[Settings system|settings]].&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14569</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14569"/>
		<updated>2008-01-06T14:52:02Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Map Elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Assault Settings=&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14568</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14568"/>
		<updated>2008-01-06T14:51:23Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* General Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Map Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14567</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14567"/>
		<updated>2008-01-06T14:50:46Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Assault Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==General Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14566</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14566"/>
		<updated>2008-01-06T14:44:59Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Assault Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
All these settings can be specified in the ''meta.xml'' [[Settings system|settings]] or the ''assaultSettings'' element in the mapfile. The ''meta.xml'' settings will always overrule the mapfile settings.&lt;br /&gt;
&lt;br /&gt;
To specifiy the settings in the ''meta.xml'' file, it may look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;driver2&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;assault&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;as-area51.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;as-area51.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;settings&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#author&amp;quot; value=&amp;quot;driver2&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;setting name=&amp;quot;#timelimit&amp;quot; value=&amp;quot;300&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;!-- more settings.. --&amp;gt;&lt;br /&gt;
	&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To specifiy the settings in the mapfile, put the ''assaultSettings'' in your mapfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IRC_Channel&amp;diff=14420</id>
		<title>IRC Channel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IRC_Channel&amp;diff=14420"/>
		<updated>2008-01-03T19:22:59Z</updated>

		<summary type="html">&lt;p&gt;Driver2: New page: There is an IRC Channel available for help with MTA Scripting. You can find it at #mta.scripting on GTAnet. ==How to get help== * Try to find your Answer on the Main Page, especially t...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is an IRC Channel available for help with MTA Scripting. You can find it at #mta.scripting on GTAnet.&lt;br /&gt;
==How to get help==&lt;br /&gt;
* Try to find your Answer on the [[Main Page]], especially the ''Getting Started'' section&lt;br /&gt;
* Ask your question once and only repeat it after a reasonable amount of time, given the channel is busy and people just coming online won't see your question else (like 10 minutes). NOT after 10 seconds.&lt;br /&gt;
* Your question should at least contain:&lt;br /&gt;
** What are you trying to do.&lt;br /&gt;
** What have you done so far.&lt;br /&gt;
** What exactly doesn't work/is your problem. What errors are occuring.&lt;br /&gt;
** Maybe a code snippet with an explanation using [http://mta.pastebin.com mta.pastebin.com] (''code snippet means the relevant parts, NOT the whole script'')&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14170</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14170"/>
		<updated>2008-01-01T04:15:05Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Example map */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Gamemode_Assault&amp;diff=14031</id>
		<title>Gamemode Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Gamemode_Assault&amp;diff=14031"/>
		<updated>2007-12-31T20:30:02Z</updated>

		<summary type="html">&lt;p&gt;Driver2: Gamemode Assault moved to Resource:Assault: New Resource Namespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Resource:Assault]]&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14030</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14030"/>
		<updated>2007-12-31T20:30:02Z</updated>

		<summary type="html">&lt;p&gt;Driver2: Gamemode Assault moved to Resource:Assault: New Resource Namespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Writing_Gamemodes&amp;diff=14022</id>
		<title>Writing Gamemodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Writing_Gamemodes&amp;diff=14022"/>
		<updated>2007-12-31T18:10:41Z</updated>

		<summary type="html">&lt;p&gt;Driver2: New page: This Guide tries to outline the process of how to write a proper gamemode. If you just started with scripting for MTA, you may want to check the other tutorials at the [[Scripting|Scriptin...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Guide tries to outline the process of how to write a proper gamemode. If you just started with scripting for MTA, you may want to check the other tutorials at the [[Scripting|Scripting Page]] first.&lt;br /&gt;
==Introduction==&lt;br /&gt;
A Gamemode is a resource that, once started, controls all of the gameplay. This may include telling the players what to do, spawning players, creating teams, defining what the players have to do to win or to get points and much more. For some of the functionality a gamemode has to provide, there are other resources that can help it to do that.&lt;br /&gt;
&lt;br /&gt;
==What does &amp;quot;proper gamemode&amp;quot; mean?==&lt;br /&gt;
To put it simply, a proper gamemode is one that makes full use of MTA's .map file system. This means that you can have the gamemode, but change the .map file of key parts of the gamemode so that there can be lots of maps for this gamemode.&lt;br /&gt;
&lt;br /&gt;
An obvious example of what i define as a &amp;quot;proper gamemode&amp;quot; is that of Race mod - MTA:Race. It allows usermade maps with lots of possibilities within the .map file. To alter spawnpoints, or objects etc, the user does not need to look at editing the gamemode itself.&lt;br /&gt;
&lt;br /&gt;
Examples of what i dont consider gamemodes, are ones that have everything hardcoded within the script. This goes for vehicles, spawnpoints, objects.&lt;br /&gt;
&lt;br /&gt;
===Map Files===&lt;br /&gt;
So what kind of things should the map maker have access to in the .map file? Obviously you dont want them changing key parts of your gamemode. You should stick to obvious things - spawnpoints, vehicles etc. In other words, the user should be able to move everything that happens in your gamemode to another location. It should be fairly obvious to you what kind of things the user should or should not have access to.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
For example, in a Capture the Flag gamemode, you will have important things defined in .map - vehicles, spawnpoints, objects. You will also need to allow the user to define where the flag goes - so they should be able to place a flag element in the .map. As the scripter, you can decide the syntax of the flag element in the .map file (i will come onto how to use custom elements later on). E.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;spawnpoint name=&amp;quot;spawnpoint1&amp;quot; posX=&amp;quot;1959.5487060547&amp;quot; posY=&amp;quot;-1714.4613037109&amp;quot; posZ=&amp;quot;877.25219726563&amp;quot; rot=&amp;quot;63.350006103516&amp;quot; model=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;pickup name=&amp;quot;Armor 1&amp;quot; posX=&amp;quot;1911.083984375&amp;quot; posY=&amp;quot;-1658.8798828125&amp;quot; posZ=&amp;quot;885.40216064453&amp;quot; type=&amp;quot;armor&amp;quot; health=&amp;quot;50&amp;quot; respawn=&amp;quot;60000&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;flag posX=&amp;quot;1959.5487060547&amp;quot; posY=&amp;quot;-1714.4613037109&amp;quot; posZ=&amp;quot;877.25219726563&amp;quot; team=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here you can see two MTA elements - spawnpoint and a pickup. More importantly, this .map has a 'flag' element. This means the user can easilly create their own maps by altering these elements. Again, as the scripter you can make up whatever element name you like.&lt;br /&gt;
&lt;br /&gt;
To summarise - we want mass mapper input as we saw in MTA:Race. Users should NOT even have to touch the script file itself at all.&lt;br /&gt;
&lt;br /&gt;
====Example of getting the .map information====&lt;br /&gt;
So how would you retrieve information about these &amp;quot;custom elements&amp;quot; from the map file? It is actually very simple(this assumes you have at least some knowledge on Lua and tables).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--retrieve a table of flag elements&lt;br /&gt;
local flagElements = getElementsByType ( &amp;quot;flag&amp;quot; )&lt;br /&gt;
--loop through the flag elements&lt;br /&gt;
for key, value in pairs(flagElements) do&lt;br /&gt;
	--get our info&lt;br /&gt;
	local posX = getElementData ( value, &amp;quot;posX&amp;quot; )&lt;br /&gt;
	local posY = getElementData ( value, &amp;quot;posY&amp;quot; )&lt;br /&gt;
	local posZ = getElementData ( value, &amp;quot;posZ&amp;quot; )&lt;br /&gt;
	local team = getElementData ( value, &amp;quot;team&amp;quot; )&lt;br /&gt;
	--create an object according to the flag position&lt;br /&gt;
	createObject ( 1337, posX, posY, posZ )&lt;br /&gt;
	--output the team that we created a base for&lt;br /&gt;
	outputChatBox ( &amp;quot;Base for team &amp;quot;..team..&amp;quot; created&amp;quot; )&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The getElementsByType function retrieves a table of all the elements of a certain type. This works for custom elements or real MTA elements.&lt;br /&gt;
getElementData can be used to retrieve the xml attributes set in the .map file.&lt;br /&gt;
In this example, all im doing is creating an object at that position, and outputting the team. In reality, you will be creating the real base or doing whatever is necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Map manager==&lt;br /&gt;
Having read the section above it should be clear that a gamemode should always consist of two parts:&lt;br /&gt;
* The gamemode resource that stays always the same&lt;br /&gt;
* Many different maps resources that give the gamemode map-specific information&lt;br /&gt;
&lt;br /&gt;
Now instead of writing a map-loader for every single gamemode, the [[Map manager]] provides functions to load gamemodes and maps. Simply put, when you enter the correct command (for example 'gamemode ctf ctf-italy') it will start both resources 'ctf' and 'ctf-italy' while triggering an event to tell the 'ctf' resource that a map was loaded. The 'ctf' resource can then access the information 'ctf-italy' contains and start spawning players etc.&lt;br /&gt;
&lt;br /&gt;
===How to use the mapmanager===&lt;br /&gt;
To use the mapmanager service, your gamemode resource has to be tagged as such first. You'll be setting type attribute to &amp;quot;gamemode&amp;quot; in its &amp;lt;info&amp;gt; tag, inside meta.xml. Also, you can set the name attribute to set a friendly name that will be shown on ASE instead of the resource name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--meta.xml in &amp;quot;cowcatapult&amp;quot; gamemode--&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
&amp;lt;info type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Cow catapulting 2.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your gamemode is going to load custom maps, you should add handlers for&lt;br /&gt;
* onGamemodeMapStart( resource startedMap )&lt;br /&gt;
* onGamemodeMapStop ( resource stoppedMap ) (if any unloading is necessary)&lt;br /&gt;
These are fired when a map for your gamemode is started or stopped, and pass the map resource as a parameter.&lt;br /&gt;
Within that handler, you can extract all info you need from this resource's map files and configs.&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 startCtfMap( startedMap ) -- startedMap contains a reference to the resource of the map&lt;br /&gt;
	mapRoot = getResourceRootElement( startedMap ) -- get the root node of the started map&lt;br /&gt;
	local flagElements = getElementsByType ( &amp;quot;flag&amp;quot; , mapRoot ) -- get all flags in the map and store them in a table&lt;br /&gt;
	-- go on loading information like in the example above&lt;br /&gt;
	&lt;br /&gt;
	-- spawn players etc.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onGamemodeMapStart&amp;quot;, getRootElement(), startCtfMap)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Making maps compatible===&lt;br /&gt;
Maps are separate resources. This is done so no editing of the gamemode resource is ever necessary in order to create a custom map, and also allows you to pack map-specific scripts/config files with them.&lt;br /&gt;
&lt;br /&gt;
To make a map compatible with your gamemode, open its resource's meta.xml and tag it as well:&lt;br /&gt;
type attribute must be set to &amp;quot;map&amp;quot;, and gamemodes attribute must be a comma-separated list of gamemode resource names (without spaces).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!--map's meta.xml--&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
&amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;cowcatapult,assault,tdm&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have everything set up, admins will use these two commands to start/stop gamemodes:&lt;br /&gt;
/gamemode gamemodeName [mapName] (optional parameter allows picking an initial map, defaults to none)&lt;br /&gt;
/changemap mapName [gamemodeName] (optional parameter specifies the gamemode to start the map with, defaults to the current one)&lt;br /&gt;
&lt;br /&gt;
[[Map manager]] exports a few more access functions which you don't have to use, but may be useful.&lt;br /&gt;
&lt;br /&gt;
==What else should you do==&lt;br /&gt;
There are several other resources that gamemodes should use/be compliant with.&lt;br /&gt;
&lt;br /&gt;
===Helpmanager===&lt;br /&gt;
The helpmanager is ought to be the standard interface for players when they need help. If you use the helpmanager to display your gamemode's help, every player that used helpmanager before (e.g. in other gamemodes) will immediately know how to get there. It also displays help for different resources running resources in one window, if necessary.&lt;br /&gt;
&lt;br /&gt;
There are basicially two ways to use the helpmanager:&lt;br /&gt;
* Provide a simple text that explains how to use your gamemode&lt;br /&gt;
* Request a GUI element from the helpmanager that will be displayed in it's own tab in the helpmanager window and lets you add any GUI elements to it. This is the recommended way for gamemodes that need to display more complex information that requires to be in it's own GUI.&lt;br /&gt;
&lt;br /&gt;
Read the helpmanager page for details on how to do it.&lt;br /&gt;
&lt;br /&gt;
===Scoreboard===&lt;br /&gt;
Scoreboard displays players and teams currently ingame. You add custom columns to it to provide map specific information. For example the column 'points' in the 'ctf' gamemode could represent the players points gained through kills or captures. As usual, see the scoreboard help page for more information.&lt;br /&gt;
&lt;br /&gt;
===Map cycler===&lt;br /&gt;
The map cycler controls what gamemodes and maps are played on a server. You can specifiy for example how many times in a row a map will be played until it switches to the next. To achieve this, you need to tell the map cycler when your gamemode finished (e.g. when a round ends).&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14004</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=14004"/>
		<updated>2007-12-30T17:33:22Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
** ''default:'' Objective '''name''' reached&lt;br /&gt;
** If '''name''' and '''successText''' are both not given, no message at all will appear when the objective is reached&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13976</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13976"/>
		<updated>2007-12-30T11:58:54Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Additional Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends or when it is destroyed, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13975</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13975"/>
		<updated>2007-12-30T11:58:35Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Additional Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile. Remember that it will never be automatically respawned then, so if you want to have it return to it's original place, for example after the round ends, you have to respawn it yourself.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13974</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13974"/>
		<updated>2007-12-30T11:49:07Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Additional Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* If you don't want a specific vehicle to be respawned by assault, set it's Elementdata item 'noRespawn' to ''true'' by script or add the attribute noRespawn=&amp;quot;1&amp;quot; to the element in the mapfile.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13972</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13972"/>
		<updated>2007-12-30T11:46:56Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Example map */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13878</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13878"/>
		<updated>2007-12-29T23:34:13Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
If there is a '''timelimit''', '''time''', '''weather''', '''author''' or '''description''' [[Settings system|setting]] specified in the meta file, it will overule the attribute in this element&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13869</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13869"/>
		<updated>2007-12-29T00:50:28Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Cameras */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
You need to define one camera of each type in a valid assault map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13851</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13851"/>
		<updated>2007-12-27T13:54:47Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#Assault Settings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13850</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13850"/>
		<updated>2007-12-27T13:54:12Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows and is displayed at the bottom of the screen to tell the attacker what to do&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
* '''defenderDescription:''' This text is shown at the bottom of the screen to tell the defenders what to do ''(default: the '''defenderText''' attribute of the [[#assaultSettings]] element)''&lt;br /&gt;
* '''successTextForDefender:''' This attribute can overwrite the '''successText''' attribute for defenders&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13849</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=13849"/>
		<updated>2007-12-27T13:46:48Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Optional Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''defenderText:''' The text that is displayed at the bottom of the screen, telling the defenders what to do. If this text is defined here, it will be set as default for the map, but can be overwritten by single objectives by specifying the according attribute in its element. ''(default: &amp;quot;Prevent attackers from reaching their objectives!&amp;quot;)''&lt;br /&gt;
* '''attackMessage:''' The message that is shown once an attacker spawns ''(default: &amp;quot;Assault the base!&amp;quot;)''&lt;br /&gt;
* '''defendMessage:''' The message that is shown once a defender spawns ''(default: &amp;quot;Defend the base!&amp;quot;)''&lt;br /&gt;
* '''conqueredMessage:''' This message replaces a part of the message that is shown when the attackers successfully reached their objectives ''(default: &amp;quot;conquered the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Red [conquered the base] in 4:39&amp;quot;&lt;br /&gt;
* '''defendedMessage:''' This message replaces a part of the message that is shown when the defenders successfully defended the objectives ''(default: &amp;quot;defended the base&amp;quot;)''&lt;br /&gt;
** This messages replaces the following part enclosed by brackets (example): &amp;quot;Blue [defended the base]. Blue wins.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It is recommended that you change the above messages only if the default messages make no or little sense for your map, in order to keep the messages (almost) the same for all maps.&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=11964</id>
		<title>Resource:Assault</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Assault&amp;diff=11964"/>
		<updated>2007-09-13T11:01:46Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assault is an objective-based team gamemode that should be similiar to Unreal Tournament's Assault. One team attacks, while the other defends. When the attacking team reached the final objective or the time runs out, the round ends and sides are switched. The team that reaches the final objective faster wins the game, if both can't reach it in the timelimit, the game ends tied.&lt;br /&gt;
&lt;br /&gt;
You can easily create your own Assault maps by placing spawnareas and objectives, and of course objects, vehicles and pickups like on any other map. The default objectives are simple checkpoints you have to enter, but the exported functions allow scripters to create whole new types of objectives. See the documentation for details.&lt;br /&gt;
&lt;br /&gt;
=How does a game work=&lt;br /&gt;
* Waiting for players before each new round for a certain amount of seconds or if enough players have joined&lt;br /&gt;
** Let players select their team&lt;br /&gt;
* Spawn players according to their team&lt;br /&gt;
* team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives&lt;br /&gt;
** if team1 reached an objective, teamspawns may be at another location, according to the next objective&lt;br /&gt;
* if the final objective is reached, the first round ends and team2 has to attack (on the same map)&lt;br /&gt;
** the timelimit for the second round should be the time team1 needed to reach the final objective&lt;br /&gt;
&lt;br /&gt;
===Winning===&lt;br /&gt;
* If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.&lt;br /&gt;
* If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.&lt;br /&gt;
* If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.&lt;br /&gt;
&lt;br /&gt;
=Creating an Assault map=&lt;br /&gt;
Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives.&lt;br /&gt;
&lt;br /&gt;
If you want to create a simple map without additional code or custom objectives, you may want to skip to the [[#Map Elements]].&lt;br /&gt;
&lt;br /&gt;
=Events/Functions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultObjectiveReached ( table objectiveReached, table players )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when an objective is successful (when it turns red).&lt;br /&gt;
* '''objectiveReached:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
* '''players:''' A table of all players that were in the marker when it was activated&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultStartRound ( team attacker )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a round actually starts (player spawns), 'attacker' is the team that attacks.&lt;br /&gt;
* '''attacker:''' A team element consisting the attacking team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultCreateObjective ( table objectiveToCreate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when a objective is created or should be created if it's a custom objective, instead of creating the marker when it would be a normal one&lt;br /&gt;
*  '''objectiveToCreate:''' A table with all the attributes supplied in the map file (see [[#Objectives|Map Elements]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onAssaultEndRound( bool conquered )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Triggers when the round ends (time up or base conquered)&lt;br /&gt;
* '''conquered:''' If the attacker was successful in completing the objectives, true otherwise false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool triggerObjective( string objectiveId, [table players] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Used to trigger an objective. Returns ''true'' if it can be triggered, ''false'' otherwise.&lt;br /&gt;
* '''objectiveId:''' ''(required)'' The id (like defined in the .map file) of the objective.&lt;br /&gt;
* '''players:''' A table of all players that were reponsible for activating the objective&lt;br /&gt;
&lt;br /&gt;
''Please note that you have to use [[Call]] with exported functions.''&lt;br /&gt;
&lt;br /&gt;
=Map Elements=&lt;br /&gt;
To create an Assault map, all of these elements are obligatory. ''Note that these elements may change during early stages of development.''&lt;br /&gt;
&lt;br /&gt;
==Assault Settings==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;assaultSettings timelimit=&amp;quot;(int=300)&amp;quot;&lt;br /&gt;
		 finishType=&amp;quot;(string)&amp;quot; 	finishObjective=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		 time=&amp;quot;(time=12:00)&amp;quot; 	weather=&amp;quot;(int=0)&amp;quot;&lt;br /&gt;
		 author=&amp;quot;{string=''}&amp;quot; 	description=&amp;quot;{string=''}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''finishType:''' when will a team have conquered the base/reached the objective&lt;br /&gt;
** '''&amp;quot;objective&amp;quot;:''' when a certain objective is reached&lt;br /&gt;
** '''&amp;quot;all&amp;quot;:''' when all objectives are reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''timelimit:''' duration of one round in seconds ''(default: 300)''&lt;br /&gt;
* '''finishObjective:''' used when finishType is set to objective&lt;br /&gt;
* '''time:''' time hours:minutes ''(default: 12:00)''&lt;br /&gt;
* '''weather:''' weather id ''(default: 0)''&lt;br /&gt;
* '''author:''' the map author ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
* '''description:''' map description ''(default: &amp;quot;&amp;quot;)''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Objectives==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;objective name=&amp;quot;(string)&amp;quot; description=&amp;quot;(string)&amp;quot; successText=&amp;quot;(string)&amp;quot; id=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&lt;br /&gt;
		posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; stay=&amp;quot;{int=0}&amp;quot;&lt;br /&gt;
		forcedRespawn=&amp;quot;{string=none}&amp;quot; markerType=&amp;quot;{string=cylinder}&amp;quot; captureType=&amp;quot;{string=foot}&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ: (required)''' position of the objective&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''name:''' the name of the objective, used for the objective list on the screen&lt;br /&gt;
* '''description:''' may be used in the help windows&lt;br /&gt;
* '''successText:''' shown when the objective is reached, use ~team~ as a variable for the attacker's team name&lt;br /&gt;
* '''id:''' unique identification for the objective&lt;br /&gt;
* '''req:''' objectives required for this objective, ids seperated by comma, e.g. req=&amp;quot;door,room1,room2&amp;quot;&lt;br /&gt;
* '''type:''' the type of the objective&lt;br /&gt;
** '''&amp;quot;checkpoint&amp;quot;:''' ''(default)'' assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it&lt;br /&gt;
** '''&amp;quot;custom&amp;quot;:''' assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)&lt;br /&gt;
* '''forcedRespawn'''&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' make all players respawn, as soon as the objective is created&lt;br /&gt;
** other values may come&lt;br /&gt;
* '''markerType:''' defines the type of the marker used to mark the objective (see [[CreateMarker]] for details on the values)&lt;br /&gt;
* '''captureType:''' defines how the objective can be activated&lt;br /&gt;
** '''&amp;quot;both&amp;quot;:''' on foot and in a vehicle&lt;br /&gt;
** '''&amp;quot;foot&amp;quot;:''' only while on foot&lt;br /&gt;
** '''&amp;quot;vehicle&amp;quot;:''' only while in a vehicle&lt;br /&gt;
* '''stay:''' number of seconds the player needs to stay in the objective&lt;br /&gt;
* '''stayText:''' the text that is shown above the progress bar while being in the objective&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawngroups==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawngroup type=&amp;quot;(string)&amp;quot; req=&amp;quot;(string)&amp;quot;&amp;gt;&lt;br /&gt;
- put spawnareas here -&lt;br /&gt;
&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example. Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''type:'''&lt;br /&gt;
** '''&amp;quot;attacker&amp;quot;:''' a spawngroup for the attacking team&lt;br /&gt;
** '''&amp;quot;defender&amp;quot;:''' a spawngroup for the defending team&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''req:''' objective ids seperated by comma required for this checkpoint to work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnareas==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;spawnarea posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; sizeX=&amp;quot;(int=2)&amp;quot; sizeY=&amp;quot;(int=2)&amp;quot; skins=&amp;quot;{int,int=0}&amp;quot; weapons=&amp;quot;{int,int;int,int=''}&amp;quot; radius=&amp;quot;{int=2}&amp;quot; shape=&amp;quot;{string=circle}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A spawnarea is a rectangle or circle in which players are spawned randomly. It is defined by one point and two size values or the radius.&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ:''' position&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)&lt;br /&gt;
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..&lt;br /&gt;
* '''shape'''&lt;br /&gt;
** '''&amp;quot;circle&amp;quot;: (default)''' a circle&lt;br /&gt;
** '''&amp;quot;rectangle&amp;quot;:''' a rectangle&lt;br /&gt;
* '''sizeX, sizeY:''' if shape=&amp;quot;rectangle&amp;quot;, the maximum number that will be added to the X or Y coordinate&lt;br /&gt;
* '''radius:''' if shape=&amp;quot;circle&amp;quot;, radius of the circle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Cameras==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;camera type=&amp;quot;(string)&amp;quot; posX=&amp;quot;(float)&amp;quot; posY=&amp;quot;(float)&amp;quot; posZ=&amp;quot;(float)&amp;quot; targetX=&amp;quot;(float)&amp;quot; targetY=&amp;quot;(float)&amp;quot; targetZ=&amp;quot;(float)&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Attributes====&lt;br /&gt;
* '''posX, posY, posZ, targetX, targetY, targetZ:''' position and look at&lt;br /&gt;
* '''type:''' defines the type of the camera, when it will be used&lt;br /&gt;
** '''&amp;quot;spawn&amp;quot;:''' after selecting the team and before spawning&lt;br /&gt;
** '''&amp;quot;selectTeam&amp;quot;:''' select Team screen&lt;br /&gt;
** '''&amp;quot;finish&amp;quot;:''' when the last objective is reached&lt;br /&gt;
&lt;br /&gt;
====Optional Attributes====&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
==Example map==&lt;br /&gt;
Check out /resources/as-area51/ on the ftp.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPickupWeapon&amp;diff=11369</id>
		<title>GetPickupWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPickupWeapon&amp;diff=11369"/>
		<updated>2007-08-26T14:42:12Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function retrieves the weapon ID of a weapon pickup.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getPickupWeapon ( pickup thePickup )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePickup:''' The pickup of which you wish to retrieve the weapon&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[Weapons|Weapon ID]] of the pickup, or ''false'' if the pickup is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example gives extra ammo to a player if a pickup only has a small amount of ammo.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPickupHitFunc ( thePlayer )                  -- when a pickup is hit&lt;br /&gt;
    if getPickupType ( source ) == 2 then               -- check if it's a weapon pickup&lt;br /&gt;
        local ammo = getPickupAmmo ( source )           -- get the pickup ammo&lt;br /&gt;
        if ammo &amp;lt; 50 then                               -- if ammo is less than 50&lt;br /&gt;
            local weapon = getPickupWeapon ( source )   -- store pickup weapon&lt;br /&gt;
            giveWeaponAmmo ( thePlayer, weapon, 50 )    -- give an extra 50 ammo&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPickupHit&amp;quot;, getRootElement(), onPickupHitFunc )    -- add the function as handler for onPickupHit&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;
{{Pickup functions}}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element&amp;diff=9993</id>
		<title>Element</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element&amp;diff=9993"/>
		<updated>2007-08-08T18:39:32Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|Need to make sure all elements are listed --[[User:Erorr404|Erorr404]] 21:44, 8 December 2006 (CST)}}&lt;br /&gt;
&lt;br /&gt;
An element is a generic class that represents almost all in-game items. These include:&lt;br /&gt;
* [[Element/Player|Players]]&lt;br /&gt;
* [[Element/Vehicle|Vehicles]]&lt;br /&gt;
* [[Element/Object|Objects]]&lt;br /&gt;
* [[Element/Pickup|Pickups]]&lt;br /&gt;
* [[Element/Marker|Markers]]&lt;br /&gt;
* [[Element/Collision shape|Collision shapes]]&lt;br /&gt;
* [[Element/Blip|Blips]]&lt;br /&gt;
* [[Element/Radar area|Radar areas]]&lt;br /&gt;
* [[Element/Team|Teams]]&lt;br /&gt;
* [[Element/Remote client|Remote clients]]&lt;br /&gt;
* [[Element/Server console|Server console]]&lt;br /&gt;
&lt;br /&gt;
These are all stored internally in a [[Element tree|&amp;quot;tree&amp;quot; structure]], as such every element has a parent element, be in the ''root'' element, ''map'' or another element. This is purely for declaring the scope of function calls.&lt;br /&gt;
&lt;br /&gt;
There are various functions for manipulating the layout of this element tree.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9991</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9991"/>
		<updated>2007-08-08T18:34:45Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Map manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
* 'root': This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* 'resource': These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* 'map': Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
** Map files can contain a number of other [[element]] types as well as an unlimited number of custom element types.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a tree of a running server. ''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         o player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         + resourcebrowser: resource&lt;br /&gt;
         + ajax: resource&lt;br /&gt;
         + resourcemanager: resource&lt;br /&gt;
         + spawnmanager: resource&lt;br /&gt;
         + echobot: resource&lt;br /&gt;
         + mapmanager: resource&lt;br /&gt;
         + runcode: resource&lt;br /&gt;
         - fr: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         + elementbrowser: resource&lt;br /&gt;
         - assault: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         - as-farm: resource&lt;br /&gt;
               o dynamic: map&lt;br /&gt;
               - as-farm.map: map&lt;br /&gt;
                     - meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     - spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     - spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     * first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     * pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
===Setting data for elements===&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;br /&gt;
&lt;br /&gt;
===Map manager===&lt;br /&gt;
The [[#Example|example above]] shows the way the mapmanger uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives the id of the started resource - in this case 'as-farm' - from which you can retrieve the root element of the resource and store it in a variable. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.&lt;br /&gt;
&lt;br /&gt;
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9990</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9990"/>
		<updated>2007-08-08T18:31:11Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
* 'root': This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* 'resource': These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* 'map': Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
** Map files can contain a number of other [[element]] types as well as an unlimited number of custom element types.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a tree of a running server. ''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         o player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         + resourcebrowser: resource&lt;br /&gt;
         + ajax: resource&lt;br /&gt;
         + resourcemanager: resource&lt;br /&gt;
         + spawnmanager: resource&lt;br /&gt;
         + echobot: resource&lt;br /&gt;
         + mapmanager: resource&lt;br /&gt;
         + runcode: resource&lt;br /&gt;
         - fr: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         + elementbrowser: resource&lt;br /&gt;
         - assault: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         - as-farm: resource&lt;br /&gt;
               o dynamic: map&lt;br /&gt;
               - as-farm.map: map&lt;br /&gt;
                     - meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     - spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     - spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     * first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     * pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
===Setting data for elements===&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;br /&gt;
&lt;br /&gt;
===Map manager===&lt;br /&gt;
The example above shows the way the mapmanger uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives the id of the started resource - in this case 'as-farm' - from which you can retrieve the root element of the resource and store it in a variable. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.&lt;br /&gt;
&lt;br /&gt;
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9989</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9989"/>
		<updated>2007-08-08T18:25:20Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Tree Elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
* 'root': This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* 'resource': These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* 'map': Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
** Map files can contain a number of other [[element]] types as well as an unlimited number of custom element types.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a tree of a running server. ''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         + resourcebrowser: resource&lt;br /&gt;
         + ajax: resource&lt;br /&gt;
         + resourcemanager: resource&lt;br /&gt;
         + spawnmanager: resource&lt;br /&gt;
         + echobot: resource&lt;br /&gt;
         + mapmanager: resource&lt;br /&gt;
         + playerblips: resource&lt;br /&gt;
         + runcode: resource&lt;br /&gt;
         - fr: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         + player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         + elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         - assault: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         - as-farm: resource&lt;br /&gt;
               o dynamic: map&lt;br /&gt;
               - as-farm.map: map&lt;br /&gt;
                     - meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     - spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     - spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     * first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     * pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
===Setting data for elements===&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;br /&gt;
&lt;br /&gt;
===Map manager===&lt;br /&gt;
The example above shows the way the mapmanger uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives the id of the started resource - in this case 'as-farm' - from which you can retrieve the root element of the resource and store it in a variable. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.&lt;br /&gt;
&lt;br /&gt;
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9988</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9988"/>
		<updated>2007-08-08T18:20:44Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Pratical Application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
When this map is loaded, it is placed within the server's element tree. This tree has a number of &amp;quot;special&amp;quot; elements.&lt;br /&gt;
&lt;br /&gt;
* A root element. This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* Resource elements. These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* Map elements. Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a tree of a running server. ''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         + resourcebrowser: resource&lt;br /&gt;
         + ajax: resource&lt;br /&gt;
         + resourcemanager: resource&lt;br /&gt;
         + spawnmanager: resource&lt;br /&gt;
         + echobot: resource&lt;br /&gt;
         + mapmanager: resource&lt;br /&gt;
         + playerblips: resource&lt;br /&gt;
         + runcode: resource&lt;br /&gt;
         - fr: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         + player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         + elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         - assault: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         - as-farm: resource&lt;br /&gt;
               o dynamic: map&lt;br /&gt;
               - as-farm.map: map&lt;br /&gt;
                     - meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     - spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     - spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     * first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     * pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
===Setting data for elements===&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;br /&gt;
&lt;br /&gt;
===Map manager===&lt;br /&gt;
The example above shows the way the mapmanger uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives the id of the started resource - in this case 'as-farm' - from which you can retrieve the root element of the resource and store it in a variable. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.&lt;br /&gt;
&lt;br /&gt;
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9987</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9987"/>
		<updated>2007-08-08T18:07:03Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
When this map is loaded, it is placed within the server's element tree. This tree has a number of &amp;quot;special&amp;quot; elements.&lt;br /&gt;
&lt;br /&gt;
* A root element. This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* Resource elements. These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* Map elements. Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a tree of a running server. ''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         + resourcebrowser: resource&lt;br /&gt;
         + ajax: resource&lt;br /&gt;
         + resourcemanager: resource&lt;br /&gt;
         + spawnmanager: resource&lt;br /&gt;
         + echobot: resource&lt;br /&gt;
         + mapmanager: resource&lt;br /&gt;
         + playerblips: resource&lt;br /&gt;
         + runcode: resource&lt;br /&gt;
         - fr: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         + player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         + elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         - assault: resource&lt;br /&gt;
               - dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         - as-farm: resource&lt;br /&gt;
               o dynamic: map&lt;br /&gt;
               - as-farm.map: map&lt;br /&gt;
                     - meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     - spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     - spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     - spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     * first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     * pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9986</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9986"/>
		<updated>2007-08-08T18:00:42Z</updated>

		<summary type="html">&lt;p&gt;Driver2: /* Explaination */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
When this map is loaded, it is placed within the server's element tree. This tree has a number of &amp;quot;special&amp;quot; elements.&lt;br /&gt;
&lt;br /&gt;
* A root element. This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* Resource elements. These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* Map elements. Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         o resourcebrowser: resource&lt;br /&gt;
         o ajax: resource&lt;br /&gt;
         o resourcemanager: resource&lt;br /&gt;
         o spawnmanager: resource&lt;br /&gt;
         o echobot: resource&lt;br /&gt;
         o mapmanager: resource&lt;br /&gt;
         o playerblips: resource&lt;br /&gt;
         o runcode: resource&lt;br /&gt;
         o fr: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         o player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         o elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         o assault: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         o as-farm: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
               + as-farm.map: map&lt;br /&gt;
                     # meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     # spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     # spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     # first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     # pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resources and 2 [[player]] elements, that are direct child elements of the 'root' element. All these resources have a 'dynamic map' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the 'assault' resource: This contains just one 'dynamic map' that has 2 teams, 3 blips, 1 marker and 1 colshape as child elements. These are the elements that are created by the script, for example the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The 'as-farm' resource's function on the contrary is to be a map for the 'assault' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automactically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9985</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9985"/>
		<updated>2007-08-08T17:43:58Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store all the elements that exist on the server. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All Elements that are created within scripts or from .map files, are child elements of the resource they belong to. Thus, most elements (except for players) exist only within resources and are also destroyed as soon as the resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree Elements==&lt;br /&gt;
When this map is loaded, it is placed within the server's element tree. This tree has a number of &amp;quot;special&amp;quot; elements.&lt;br /&gt;
&lt;br /&gt;
* A root element. This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* Resource elements. These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* Map elements. Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         o resourcebrowser: resource&lt;br /&gt;
         o ajax: resource&lt;br /&gt;
         o resourcemanager: resource&lt;br /&gt;
         o spawnmanager: resource&lt;br /&gt;
         o echobot: resource&lt;br /&gt;
         o mapmanager: resource&lt;br /&gt;
         o playerblips: resource&lt;br /&gt;
         o runcode: resource&lt;br /&gt;
         o fr: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         o player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         o elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         o assault: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         o as-farm: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
               + as-farm.map: map&lt;br /&gt;
                     # meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     # spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     # spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     # first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     # pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Explaination===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Pratical Application==&lt;br /&gt;
&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9984</id>
		<title>Element tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element_tree&amp;diff=9984"/>
		<updated>2007-08-08T17:37:50Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA uses a so-called ''element tree'' to store the elements that make up the map. This is directly related to the XML [[map file]]'s layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it like a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element. This element is the element that it is contained within in the [[map file]]. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map&amp;gt;&lt;br /&gt;
   &amp;lt;marker&amp;gt;&lt;br /&gt;
      &amp;lt;vehicle/&amp;gt;&lt;br /&gt;
   &amp;lt;/marker&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
*  root&lt;br /&gt;
         o console&lt;br /&gt;
         o resourcebrowser: resource&lt;br /&gt;
         o ajax: resource&lt;br /&gt;
         o resourcemanager: resource&lt;br /&gt;
         o spawnmanager: resource&lt;br /&gt;
         o echobot: resource&lt;br /&gt;
         o mapmanager: resource&lt;br /&gt;
         o playerblips: resource&lt;br /&gt;
         o runcode: resource&lt;br /&gt;
         o fr: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # vehicle &lt;br /&gt;
         o player {dontRespawn = false, lastSpawnarea = [object Object]}&lt;br /&gt;
         o elementbrowser: resource&lt;br /&gt;
         o player {dontRespawn = false}&lt;br /&gt;
         o assault: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
                     # team&lt;br /&gt;
                     # team&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # marker&lt;br /&gt;
                     # colshape&lt;br /&gt;
                     # blip&lt;br /&gt;
                     # blip &lt;br /&gt;
         o as-farm: resource&lt;br /&gt;
               + dynamic: map&lt;br /&gt;
               + as-farm.map: map&lt;br /&gt;
                     # meta&lt;br /&gt;
                           * author&lt;br /&gt;
                           * version&lt;br /&gt;
                           * name&lt;br /&gt;
                           * description &lt;br /&gt;
                     # spawngroup {req = , type = attacker}&lt;br /&gt;
                           * spawnarea {posY = -8.3976354598999, posX = 20.182683944702, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = attacker}&lt;br /&gt;
                           * spawnarea {posY = 32.166355133057, posX = -46.90763092041, skins = 9, ..&lt;br /&gt;
                     # spawngroup {req = , type = defender}&lt;br /&gt;
                           * spawnarea {posY = 35.214984893799, posX = -33.486911773682, skins = 9, ..} &lt;br /&gt;
                     # spawngroup {req = first, type = defender}&lt;br /&gt;
                           * spawnarea {posY = 120.22289276123, posX = -37.031703948975, skins = 9, ..} &lt;br /&gt;
                     # first: objective {type = checkpoint, description = Breach into the farm, id = first, ..}&lt;br /&gt;
                     # pickup {posY = 37.083660125732, type = weapon, ..}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, the ''vehicle'' element's parent is the ''marker'' element. As such, we call the vehicle element a ''child'' element of the ''marker'' element.&lt;br /&gt;
&lt;br /&gt;
When this map is loaded, it is placed within the server's element tree. This tree has a number of &amp;quot;special&amp;quot; elements.&lt;br /&gt;
&lt;br /&gt;
* A root element. This is at the very base of the tree - all elements are children (or grand children etc) of this element.&lt;br /&gt;
* Resource elements. These are direct children of the root element - with one for each ''running'' resource.&lt;br /&gt;
* Map elements. Each resource element contains at least 1 map element, representing either a &amp;quot;.map&amp;quot; file in the resource or containing the elements created by scripts (this is called the &amp;quot;dynamic&amp;quot; map).&lt;br /&gt;
&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes in to its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Local&amp;diff=9970</id>
		<title>Local</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Local&amp;diff=9970"/>
		<updated>2007-08-07T19:27:32Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A local variable only exists within the scope it is specified. The scope is the 'level' it is visible for the script and thus readable and editable.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
You should use local variables anytime it is possible, when you don't need to access them globally. This saves you from having troubles with duplicate variable names.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showMoney(source)&lt;br /&gt;
	local playermoney = getPlayerMoney ( source )&lt;br /&gt;
	outputChatBox(playermoney)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''playermoney'' variable only exists within the 'showMoney' function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox(&amp;quot;This is your status:&amp;quot;,player)&lt;br /&gt;
if (showHealth == true) then&lt;br /&gt;
	local health = getPlayerHealth(player)&lt;br /&gt;
	outputChatBox(&amp;quot;Heahlth: &amp;quot;..health,player)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''health'' variable only exists within the ''if''-condition block, that is between the 'then' and the 'end'.&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerOnGround&amp;diff=9958</id>
		<title>IsPlayerOnGround</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerOnGround&amp;diff=9958"/>
		<updated>2007-08-07T12:04:10Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to determine whether or not a player is on the ground. This is for on-foot usage only.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerOnGround ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] you are checking.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is on the ground, ''false'' otherwise and if he is in a vehicle capable of flying.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This examle checks if the player who enters the 'amiflying' command is on the ground and outputs a message&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; [lua]&lt;br /&gt;
function isHeFlying ( source, key )&lt;br /&gt;
  if ( isPlayerOnGround ( source ) ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;no, you're not flying, you're just stoned!&amp;quot; )&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( &amp;quot;is it a bird, is it a plane.. no its &amp;quot; .. getClientName ( source ) )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;amiflying&amp;quot;, isHeFlying )&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>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=9957</id>
		<title>IsPlayerNametagShowing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerNametagShowing&amp;diff=9957"/>
		<updated>2007-08-07T12:03:43Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
&amp;lt;!-- Describe in plain english what this function does. Don't go into details, just give an overview --&amp;gt;&lt;br /&gt;
This function will allow you to determine if a player's name tag is currently showing.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPlayerNametagShowing ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''thePlayer:''' The player whose current name tag condition you want to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example toggles a player's nametag. If no playername is given, it toggles the nametag of the player who entered the command.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleNametag(player,command,who)&lt;br /&gt;
	local tplayer = player -- define 'tplayer' as the player who called the command&lt;br /&gt;
	if (who ~= nil) then -- if there was a nick entered in the command&lt;br /&gt;
		tplayer = getPlayerFromNick(who) -- search for the player&lt;br /&gt;
	else&lt;br /&gt;
		who = getClientName(player)&lt;br /&gt;
	end&lt;br /&gt;
	if (tplayer ~= false) then -- if the player was found (or no playername was entered)&lt;br /&gt;
		if (isPlayerNametagShowing(tplayer) == true) then -- if the nametag is shown&lt;br /&gt;
			setPlayerNametagShowing(tplayer,false) -- hide it&lt;br /&gt;
			outputChatBox(&amp;quot;Nametag is now hidden for &amp;quot;..who,player) -- output a message to the player who entered the command&lt;br /&gt;
		else -- if the nametag is not shown&lt;br /&gt;
			setPlayerNametagShowing(tplayer,true) -- show it&lt;br /&gt;
			outputChatBox(&amp;quot;Nametag is now showing for &amp;quot;..who,player) -- output a message to the player who entered the command&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Player not found.&amp;quot;,player)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;toggleNametag&amp;quot;,toggleNametag)&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;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMuted&amp;diff=9956</id>
		<title>IsPlayerMuted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMuted&amp;diff=9956"/>
		<updated>2007-08-07T12:03:26Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns true if a player has been muted and false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMuted ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''player''': The [[player]] you are checking.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if a player has been muted and false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if ( isPlayerMuted ( findPlayer ( &amp;quot;someGuy&amp;quot; ) ) then&lt;br /&gt;
   outputChatBox ( &amp;quot;It seems Someguy can't speak to you.&amp;quot;, player )&lt;br /&gt;
 end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerMapForced&amp;diff=9955</id>
		<title>IsPlayerMapForced</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerMapForced&amp;diff=9955"/>
		<updated>2007-08-07T12:03:11Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function checks if the specified player's radar-map has been forced on or not.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerMapForced ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': A [[player]] object referencing the specified player&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player's radar-map is forced on, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example forces a players radar-map on for 10seconds if it hasnt been already&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function forceMapForPlayer(callingPlayer,command,who)&lt;br /&gt;
	player = getPlayerFromNick ( who ) -- do we have a player named &amp;quot;dave&amp;quot;&lt;br /&gt;
	if ( player ) then&lt;br /&gt;
	  if ( isPlayerMapForced ( player ) == false ) then -- if his radar-map isn't already forced on&lt;br /&gt;
	    forcePlayerMap ( player, true ) -- force it on&lt;br /&gt;
	    setTimer ( forcePlayerMap, 10000, 1, player, false ) -- force it off in 10secs&lt;br /&gt;
		outputChatBox(&amp;quot;Forcing Map for &amp;quot;..who,callingPlayer) -- output a message to the one who entered the command&lt;br /&gt;
	  else&lt;br /&gt;
		outputChatBox(&amp;quot;Map already forced for &amp;quot;..who,callingPlayer) -- if the map is already forced, output a message&lt;br /&gt;
	  end&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Couldn't find &amp;quot;..who,callingPlayer) -- if the player wasn't found, output a message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;forceMap&amp;quot;, forceMapForPlayer) -- add a command handler&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>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInVehicle&amp;diff=9954</id>
		<title>IsPlayerInVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInVehicle&amp;diff=9954"/>
		<updated>2007-08-07T12:03:01Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if a player is in a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInVehicle ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] element you are checking.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is inside a vehicle, ''false'' if he isn't or an invalid player was passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code defines an ''isinvehicle'' command which tells a player whether another player is in a vehicle or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we create our handler function, where sourcePlayer is the player who sent the command,&lt;br /&gt;
-- and checkedPlayerName is the player name specified.&lt;br /&gt;
function outputIsInVehicle ( sourcePlayer, commandName, checkedPlayerName )&lt;br /&gt;
	-- we get the player element from the nick specified&lt;br /&gt;
	local checkedPlayer = getPlayerFromNick ( checkedPlayerName )&lt;br /&gt;
	-- if it exists,&lt;br /&gt;
	if ( checkedPlayer ) then&lt;br /&gt;
		-- if it's in a vehicle,&lt;br /&gt;
		if isPlayerInVehicle ( checkedPlayer ) then&lt;br /&gt;
			-- tell the source player&lt;br /&gt;
			outputChatBox ( checkedPlayerName .. &amp;quot; is in a vehicle.&amp;quot;, sourcePlayer )&lt;br /&gt;
		-- if it's not in a vehicle,&lt;br /&gt;
		else&lt;br /&gt;
			-- tell the source player&lt;br /&gt;
			outputChatBox ( checkedPlayerName .. &amp;quot; is not in a vehicle.&amp;quot;, sourcePlayer )&lt;br /&gt;
		end&lt;br /&gt;
	-- if it doesn't exist,&lt;br /&gt;
	else&lt;br /&gt;
		-- tell the source player&lt;br /&gt;
		outputChatBox ( &amp;quot;Invalid player name.&amp;quot;, sourcePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- define a handler for the isinvehicle command&lt;br /&gt;
addCommandHandler ( &amp;quot;isinvehicle&amp;quot;, outputIsInVehicle )&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>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerDucked&amp;diff=9953</id>
		<title>IsPlayerDucked</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerDucked&amp;diff=9953"/>
		<updated>2007-08-07T12:02:43Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if the specified [[player]] is ducked (crouched) or not.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerDucked ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': A [[player]] object referencing the specified player&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is ducked, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks if a random player is ducked or not, and if so displays a message in the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
aPlayer = getRandomPlayer ( )&lt;br /&gt;
if ( isPlayerDucked ( aPlayer ) ) then&lt;br /&gt;
	outputChatBox ( getClientName ( aPlayer ) .. &amp;quot; is currently crouching.&amp;quot; )&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>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerDoingTask&amp;diff=9952</id>
		<title>IsPlayerDoingTask</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerDoingTask&amp;diff=9952"/>
		<updated>2007-08-07T12:02:12Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function checks if the specified player is carrying out a certain [[List of player tasks|task]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerDoingTask ( player thePlayer, string taskName )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': A [[player]] object referencing the specified player.&lt;br /&gt;
* '''taskName''': A string containing the name of the [[List of player tasks|task]] you're checking for.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is currently doing the task, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks if the player who entered the 'doingdriveby' command is doing a drive-by (clientside).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function amIDoingADriveby ()&lt;br /&gt;
  if ( isPlayerDoingTask ( getLocalPlayer(), &amp;quot;TASK_SIMPLE_GANG_DRIVEBY&amp;quot; ) ) then&lt;br /&gt;
    outputChatBox ( getPlayerName ( getLocalPlayer() ) .. &amp;quot; is doing a driveby!!!&amp;quot; )&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( getPlayerName ( getLocalPlayer() ) .. &amp;quot; is not doing a driveby&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;doingdriveby&amp;quot;, amIDoingADriveby )&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>Driver2</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerDead&amp;diff=9951</id>
		<title>IsPlayerDead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerDead&amp;diff=9951"/>
		<updated>2007-08-07T12:01:57Z</updated>

		<summary type="html">&lt;p&gt;Driver2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if the specified [[player]] is dead or not.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerDead ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': A [[player]] object referencing the specified player&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the player is dead, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks if a random player is dead, and if so displays a message in the chat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player = getRandomPlayer ( )&lt;br /&gt;
if ( isPlayerDead ( player ) ) then&lt;br /&gt;
	outputChatBox ( getClientName ( player ) .. &amp;quot; has bitten the dust.&amp;quot; )&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>Driver2</name></author>
	</entry>
</feed>