

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.zeroy.com/index.php?action=history&amp;feed=atom&amp;title=Arrays</id>
	<title>Arrays - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.zeroy.com/index.php?action=history&amp;feed=atom&amp;title=Arrays"/>
	<link rel="alternate" type="text/html" href="https://wiki.zeroy.com/index.php?title=Arrays&amp;action=history"/>
	<updated>2026-04-29T04:34:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=5687&amp;oldid=prev</id>
		<title>CoDEmanX at 18:38, 28 July 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=5687&amp;oldid=prev"/>
		<updated>2009-07-28T18:38:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:38, 28 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== [[&lt;/del&gt;Arrays&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Note|&lt;/ins&gt;Arrays &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are objects that store several variables. These can be integers, strings, entities or even other arrays.}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Image:Nutshell.png]] &lt;/del&gt;Arrays &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are objects that store several variables. These can be integers, strings, entities or even other arrays.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== &lt;/ins&gt;Arrays &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are extremely helpful when it comes to doing the same thing to several different objects, such as moving a few platforms by a certain amount in a map, or storing lots of related variables.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are extremely helpful when it comes to doing the same thing to several different objects, such as moving a few platforms by a certain amount in a map, or storing lots of related variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>CoDEmanX</name></author>
	</entry>
	<entry>
		<id>https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=5680&amp;oldid=prev</id>
		<title>CoDEmanX at 18:33, 28 July 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=5680&amp;oldid=prev"/>
		<updated>2009-07-28T18:33:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:33, 28 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are a complicated part of scripting, but once you have them understood, they are one of the most useful things in the game.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are a complicated part of scripting, but once you have them understood, they are one of the most useful things in the game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Call of Duty]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Scripting]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>CoDEmanX</name></author>
	</entry>
	<entry>
		<id>https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=1844&amp;oldid=prev</id>
		<title>Novemberdobby at 23:39, 23 October 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=1844&amp;oldid=prev"/>
		<updated>2008-10-23T23:39:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== [[Arrays]] ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Nutshell.png]] Arrays are objects that store several variables. These can be integers, strings, entities or even other arrays.&lt;br /&gt;
&lt;br /&gt;
Arrays are extremely helpful when it comes to doing the same thing to several different objects, such as moving a few platforms by a certain amount in a map, or storing lots of related variables.&lt;br /&gt;
&lt;br /&gt;
To create an array we simply type...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 arrayName = [];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, to add an object/variable to this array, we can simply use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 array(array.size) = &amp;quot;a string variable&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Whenever you see array.size, the .size does not mean it&amp;#039;s dimensions, but the amount of items in the array. So if an array contains 1 piece of data, the array.size is 1. To retrieve an items from an array, you can use array[0] for the first object/var stored in it, and then array[1] and so on for successive items.&lt;br /&gt;
&lt;br /&gt;
Going back to the example above, we could retrieve the data by using array[0]. The first item in an array is listed as 0, the second as 1, and so on. This means that by using array(array.size) = &amp;quot;blah&amp;quot;;, we can add new items to it because of the offset of 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A common use for an array is to call a function on all of the players in the game. This can be done by using an array with a FOR loop.&lt;br /&gt;
To start with we must get our array of players, and instead of using the above method of defining an array and adding custom data, we can use a builtin function.&lt;br /&gt;
&lt;br /&gt;
 players = getEntArray(&amp;quot;player&amp;quot;, &amp;quot;classname&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
So, our array has been defined as &amp;quot;players&amp;quot;, or more accurately, &amp;quot;players[]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Inside &amp;quot;players[]&amp;quot; is every player on the server, and now all we need to do is use the array to thread a function to each player.&lt;br /&gt;
So, here we have a for loop to do such a thing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 for(i = 0; i &amp;lt; players.size; i++)&lt;br /&gt;
 {&lt;br /&gt;
   players[i] thread function();&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
That&amp;#039;s our loop to go through every player and call function(); on them.&lt;br /&gt;
&lt;br /&gt;
Remember, &amp;#039;i&amp;#039; is a variable not a letter, so &amp;#039;i&amp;#039; is substitued with the number of the loop.&lt;br /&gt;
In the first loop, &amp;#039;i&amp;#039; equals 0, so:&lt;br /&gt;
&lt;br /&gt;
 players[0] thread function();&lt;br /&gt;
&lt;br /&gt;
is executed.&lt;br /&gt;
&lt;br /&gt;
Arrays are a complicated part of scripting, but once you have them understood, they are one of the most useful things in the game.&lt;/div&gt;</summary>
		<author><name>Novemberdobby</name></author>
	</entry>
	<entry>
		<id>https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=494&amp;oldid=prev</id>
		<title>Zeroy: New page: == Arrays ==  Image:Nutshell.png Arrays are &quot;multivariables&quot;. You can store several pieces of data within a single array. This can be integers, strings or pieces of data such as ta...</title>
		<link rel="alternate" type="text/html" href="https://wiki.zeroy.com/index.php?title=Arrays&amp;diff=494&amp;oldid=prev"/>
		<updated>2008-10-15T16:53:49Z</updated>

		<summary type="html">&lt;p&gt;New page: == &lt;a href=&quot;/index.php?title=Arrays&quot; title=&quot;Arrays&quot;&gt;Arrays&lt;/a&gt; ==  &lt;a href=&quot;/index.php?title=File:Nutshell.png&quot; title=&quot;File:Nutshell.png&quot;&gt;Image:Nutshell.png&lt;/a&gt; Arrays are &amp;quot;multivariables&amp;quot;. You can store several pieces of data within a single array. This can be integers, strings or pieces of data such as ta...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== [[Arrays]] ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Nutshell.png]] Arrays are &amp;quot;multivariables&amp;quot;. You can store several pieces of data within a single array. This can be integers, strings or pieces of data such as targetnames and etc.&lt;br /&gt;
&lt;br /&gt;
Arrays are the answwer to having to use multiple variables or in mapping, you can use a single targetname.&lt;br /&gt;
&lt;br /&gt;
Arrays are the key to more efficient scripts and maps. If your map contains lots of entities which do the exact same thing (such as moving platforms) then you should be using an array to manipulate them.&lt;br /&gt;
&lt;br /&gt;
To create an array we simply type...&lt;br /&gt;
&lt;br /&gt;
 arrayName = [];&lt;br /&gt;
&lt;br /&gt;
Now we have an array, we need to add to this array, this would be a pretty advanced process if the IW developers had not built a function for us. The function can be accessed using...&lt;br /&gt;
&lt;br /&gt;
 maps\mp\_utility::add_to_array(array, ent);[/code]&lt;br /&gt;
&lt;br /&gt;
So, for example, we have an array called &amp;quot;arrayName&amp;quot; and what we want to add is a string in a variable named &amp;quot;arrayString&amp;quot;, put that into the above code...&lt;br /&gt;
&lt;br /&gt;
 maps\mp\_utility::add_to_array(arrayName, arrayString);&lt;br /&gt;
&lt;br /&gt;
Now, a couple of things to remember about arrays is their size.&lt;br /&gt;
Whenever you see, &amp;lt;ent&amp;gt;.size the .size does not mean dimension, but &amp;quot;how many&amp;quot;. So if an array contains 1 piece of data, the array.size is 1.&lt;br /&gt;
Another thing is calling the array. A piece of data is called from an array using the array number...&lt;br /&gt;
&lt;br /&gt;
So, if we go back to the example, we have just put arrayString inside arrayName, so our arrayName.size = 1. To get that information back we use&lt;br /&gt;
&lt;br /&gt;
 arrayName[0]&lt;br /&gt;
&lt;br /&gt;
This is where it gets a little confusing. Your array size is always 1 bigger than you array, this is because your array starts at 0.&lt;br /&gt;
If you had 10 pieces of data in the array, the size would be ten but you would only be able to call [0]-[9].&lt;br /&gt;
&lt;br /&gt;
A common use for the array is to thread a function to all of the players on the server. This can be done using an array with a for loop.&lt;br /&gt;
So, first off we must get our array, and instead of using the above method of defining an array and adding custom data, we use a builtin command.&lt;br /&gt;
&lt;br /&gt;
 players = getEntArray(&amp;quot;player&amp;quot;, &amp;quot;classname&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
So, our array has been defined as &amp;quot;players&amp;quot; or more accurately &amp;quot;players[]&amp;quot;&lt;br /&gt;
Inside &amp;quot;players[]&amp;quot; is every player on the server, and now all we need to do is use the array to thread a function to each player.&lt;br /&gt;
So, here we have a for loop to do such a thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 for(i=0;i&amp;lt;players.size;i++)&lt;br /&gt;
&lt;br /&gt;
Thats our loop, &amp;#039;i=0&amp;#039; (do not change this number, it is important). While &amp;#039;i&amp;#039; is LESS than &amp;#039;players.size&amp;#039; (remember, the size is always 1 bigger than the final number in the array), &amp;#039;i++&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   players[i] thread function();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And that above simply threads the function to each person in the array. Remember, &amp;#039;i&amp;#039; is a variable not a letter, so &amp;#039;i&amp;#039; is substitued with the number of the loop.&lt;br /&gt;
The first loop, &amp;#039;i&amp;#039; equals 0, so&lt;br /&gt;
&lt;br /&gt;
 players[0] thread function();&lt;br /&gt;
&lt;br /&gt;
The second loop, &amp;#039;i&amp;#039; equals 1 and etc.&lt;br /&gt;
If the amount of players on the server is 10 then loop will loop while &amp;#039;i&amp;#039; is less than the size of the array (10). This means the &amp;#039;i&amp;#039; will equal 0,1,2...,9.&lt;br /&gt;
&lt;br /&gt;
Arrays are a complicated part of scripting, but once you have them understood, they are one of the most useful things.&lt;/div&gt;</summary>
		<author><name>Zeroy</name></author>
	</entry>
</feed>