<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/index.php?action=history&amp;feed=atom&amp;title=Introduction_to_Pawn</id>
	<title>Introduction to Pawn - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/index.php?action=history&amp;feed=atom&amp;title=Introduction_to_Pawn"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Introduction_to_Pawn&amp;action=history"/>
	<updated>2026-06-26T18:57:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Introduction_to_Pawn&amp;diff=2122&amp;oldid=prev</id>
		<title>BAILOPAN at 15:06, 16 January 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Introduction_to_Pawn&amp;diff=2122&amp;oldid=prev"/>
		<updated>2006-01-16T15:06:35Z</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;=Introduction=&lt;br /&gt;
This guide is designed to give you a very basic overview to fundamentals of scripting in Pawn.  [[Pawn]] is a &amp;quot;scripting&amp;quot; language used to embed functionality in other programs. There are two kinds of languages. The first is a language like C or C++, a &amp;quot;compiled&amp;quot; language which outputs executable binaries. The other is &amp;quot;interpreted&amp;quot; which is run through a virtual machine that runs code on the fly. [[AMX]]/Pawn is a mixture of the two: You compile it, but the binaries are interpreted.&lt;br /&gt;
&lt;br /&gt;
There a few important constructs you should know before you begin to script. The first is a &amp;quot;[[variable]]&amp;quot;. A variable is a symbol, or marker, that holds data. For example, the variable &amp;quot;a&amp;quot; could hold the number &amp;quot;2&amp;quot;, &amp;quot;16&amp;quot;, &amp;quot;0&amp;quot;, et cetera. Variables are created for storage space throughout a program. It is your responsibility to declare the names of variables you will be using before you use them. Variables are assigned data with the equal sign:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;new a,b,c,d&lt;br /&gt;
&lt;br /&gt;
a=5&lt;br /&gt;
b=16&lt;br /&gt;
c=0&lt;br /&gt;
d=500&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next important concept is [[functions]]. Functions are symbols or markers that do something when called. That means when you activate them, they carry out actions on the data you supply to them. There are a few types of functions, but every function is activated the same way. For example, say the &amp;quot;show&amp;quot; function prints a number to the screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;show(56)   //Activates &amp;quot;show&amp;quot; function, and gives the number 56 to it&lt;br /&gt;
show()     //Activates &amp;quot;show&amp;quot; function with no data, blank&lt;br /&gt;
show(a)    //Activates &amp;quot;show&amp;quot; function, gives a variable's contents as data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note any text that appears after a &amp;quot;//&amp;quot; is considered a &amp;quot;comment&amp;quot; and is not actual code. For every piece of data you pass to a function, it is called a &amp;quot;[[parameter]]&amp;quot;. A function can have any number of parameters, and you need to make sure the data you give each parameter is correct. If a function takes in two numbers, you cannot give it words. Functions may also return data, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;new b&lt;br /&gt;
b = add(5, 7)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, if &amp;quot;add&amp;quot; is a function that adds the first parameter to the second and returns the answer, the variable &amp;quot;b&amp;quot; will be assigned the number 12.&lt;br /&gt;
&lt;br /&gt;
The next concept is block coding. You can group code into &amp;quot;blocks&amp;quot; separated by { and }. This effectively makes one large block of code act as one piece. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
   here&lt;br /&gt;
   is&lt;br /&gt;
   some&lt;br /&gt;
   code&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a common practice to always use block coding when possible, and to indent the code in between the block delimiters.&lt;br /&gt;
&lt;br /&gt;
This should give you a VERY brief necessary background to learning Pawn.  &lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>BAILOPAN</name></author>
		
	</entry>
</feed>