<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.vc-mp.org/index.php?action=history&amp;feed=atom&amp;title=Scripting%2FSquirrel%2FFunctions%2FPlayer.GetWeaponAtSlot</id>
	<title>Scripting/Squirrel/Functions/Player.GetWeaponAtSlot - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.vc-mp.org/index.php?action=history&amp;feed=atom&amp;title=Scripting%2FSquirrel%2FFunctions%2FPlayer.GetWeaponAtSlot"/>
	<link rel="alternate" type="text/html" href="http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Player.GetWeaponAtSlot&amp;action=history"/>
	<updated>2026-04-09T23:15:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Player.GetWeaponAtSlot&amp;diff=19697&amp;oldid=prev</id>
		<title>Thijn at 18:48, 30 January 2017</title>
		<link rel="alternate" type="text/html" href="http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Player.GetWeaponAtSlot&amp;diff=19697&amp;oldid=prev"/>
		<updated>2017-01-30T18:48:11Z</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:48, 30 January 2017&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-l53&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&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;{{Scripting/Squirrel/Functions/Player_Functions}}&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;{{Scripting/Squirrel/Functions/Player_Functions}}&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;== Related Functions ==&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;&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;{{Scripting/Squirrel/Functions/Player_Functions}}&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/Squirrel/Functions/Player_Functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Thijn</name></author>
	</entry>
	<entry>
		<id>http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Player.GetWeaponAtSlot&amp;diff=19078&amp;oldid=prev</id>
		<title>VK.Angel.OfDeath: Created page with &quot;This function is used to get the weapon ID of the weapon the player is carrying at the entered slot ID.  == Syntax ==  &lt;pre&gt;Player.GetWeaponAtSlot( slot );&lt;/pre&gt;  == Arguments...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Player.GetWeaponAtSlot&amp;diff=19078&amp;oldid=prev"/>
		<updated>2016-03-13T12:04:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This function is used to get the weapon ID of the weapon the player is carrying at the entered slot ID.  == Syntax ==  &amp;lt;pre&amp;gt;Player.GetWeaponAtSlot( slot );&amp;lt;/pre&amp;gt;  == Arguments...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This function is used to get the weapon ID of the weapon the player is carrying at the entered slot ID.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Player.GetWeaponAtSlot( slot );&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;int&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;slot&amp;#039;&amp;#039;&amp;#039; - The weapon slot ID.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;source lang=squirrel&amp;gt;&lt;br /&gt;
function onPlayerCommand( player, cmd, text )&lt;br /&gt;
{&lt;br /&gt;
    if ( cmd == &amp;quot;wepslot&amp;quot; ) // Command for calling the function.&lt;br /&gt;
    {&lt;br /&gt;
		SlotWeapons(player); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Comments about what each Slot stores.&lt;br /&gt;
&lt;br /&gt;
Slot 0: Hats, unarmed, Brass, etc...&lt;br /&gt;
Slot 1: Katana, chainsaw, hammer, etc...&lt;br /&gt;
Slot 2: Grenades, molotov, tear gas, etc...&lt;br /&gt;
Slot 3: Colt45, Python, etc...&lt;br /&gt;
Slot 4: Stubby, Spaz, Shotgun, etc...&lt;br /&gt;
Slot 5: Uzi, MP5, Ingram, etc...&lt;br /&gt;
Slot 6: M4, Ruger, etc...&lt;br /&gt;
Slot 7: M60, RPG, Minigun, etc...&lt;br /&gt;
Slot 8: Laser sniper, sniper, etc...&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
function SlotWeapons(player)// A function containing the code.&lt;br /&gt;
{&lt;br /&gt;
	local WeaponID;&lt;br /&gt;
	for (local i = 0; i &amp;lt;= 8; i++)// Loops from slot 0 to 8.&lt;br /&gt;
	{&lt;br /&gt;
		WeaponID = player.GetWeaponAtSlot(i); // Will return the weapon ID&lt;br /&gt;
		MessagePlayer( &amp;quot;Player Weapon slot &amp;quot; + i + &amp;quot;: &amp;quot; + GetWeaponName(WeaponID), player ); // Displays the name of the weapons in each slot&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[onPlayerCommand]], [[Scripting/Squirrel/Functions/GetWeaponName|GetWeaponName]] and [[Scripting/Squirrel/Functions/MessagePlayer|MessagePlayer]] were used in this example. More info about them in the corresponding pages.&lt;br /&gt;
&lt;br /&gt;
== Related Functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting/Squirrel/Functions/Player_Functions}}&lt;/div&gt;</summary>
		<author><name>VK.Angel.OfDeath</name></author>
	</entry>
</feed>