<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/OnPlayerWeaponReload?action=history&amp;feed=atom</id>
	<title>OnPlayerWeaponReload - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/OnPlayerWeaponReload?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponReload&amp;action=history"/>
	<updated>2026-05-07T17:18:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponReload&amp;diff=81801&amp;oldid=prev</id>
		<title>Derex: Created page with &quot;__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22909|This event is triggered when a player is reloading their weapon.}}  ==Parameters== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int weapon, int ammoInClip, int ammo &lt;/syntaxhighlight&gt;  *'''weapon''':  an int representing weapon used for firing a shot. *'''ammoInClip''': an int amount of ammo left for this weapon type in clip. *'''ammo''': an int amount of ammo left for this weapon...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponReload&amp;diff=81801&amp;oldid=prev"/>
		<updated>2025-02-10T12:34:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22909|This event is triggered when a &lt;a href=&quot;/wiki/Player&quot; class=&quot;mw-redirect&quot; title=&quot;Player&quot;&gt;player&lt;/a&gt; is reloading their weapon.}}  ==Parameters== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int weapon, int ammoInClip, int ammo &amp;lt;/syntaxhighlight&amp;gt;  *&amp;#039;&amp;#039;&amp;#039;weapon&amp;#039;&amp;#039;&amp;#039;:  an &lt;a href=&quot;/wiki/Int&quot; title=&quot;Int&quot;&gt;int&lt;/a&gt; representing &lt;a href=&quot;/wiki/Weapons&quot; title=&quot;Weapons&quot;&gt;weapon&lt;/a&gt; used for firing a shot. *&amp;#039;&amp;#039;&amp;#039;ammoInClip&amp;#039;&amp;#039;&amp;#039;: an &lt;a href=&quot;/wiki/Int&quot; title=&quot;Int&quot;&gt;int&lt;/a&gt; amount of ammo left for this &lt;a href=&quot;/wiki/Weapons&quot; title=&quot;Weapons&quot;&gt;weapon&lt;/a&gt; type in clip. *&amp;#039;&amp;#039;&amp;#039;ammo&amp;#039;&amp;#039;&amp;#039;: an &lt;a href=&quot;/wiki/Int&quot; title=&quot;Int&quot;&gt;int&lt;/a&gt; amount of ammo left for this weapon...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22909|This event is triggered when a [[player]] is reloading their weapon.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int weapon, int ammoInClip, int ammo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''weapon''':  an [[int]] representing [[weapons|weapon]] used for firing a shot.&lt;br /&gt;
*'''ammoInClip''': an [[int]] amount of ammo left for this [[weapons|weapon]] type in clip.&lt;br /&gt;
*'''ammo''': an [[int]] amount of ammo left for this [[weapons|weapon]] type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Source==  &lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who's reloading their weapon.  &lt;br /&gt;
&lt;br /&gt;
===Canceling===  &lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], then the players will not be able to reload their [[weapons|weapon]] manually by pressing R key. &lt;br /&gt;
The weapons will still reload when the '''ammoInClip''' reaches zero. Using [[SetGlitchEnabled|quickreload]] will also reload the [[weapons|weapon]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will output informations when a [[player]]'s weapon is reloading.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWeaponReload&amp;quot;, root, function(weapon, ammoInClip, ammo) &lt;br /&gt;
    outputChatBox(getPlayerName(source) .. &amp;quot; is reloading their weapon: &amp;quot;)&lt;br /&gt;
    outputChatBox(&amp;quot;Weapon: &amp;quot; .. getWeaponNameFromID(weapon))&lt;br /&gt;
    outputChatBox(&amp;quot;AmmoInClip: &amp;quot; .. ammoInClip)&lt;br /&gt;
    outputChatBox(&amp;quot;Ammo: &amp;quot; .. ammo)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Derex</name></author>
	</entry>
</feed>