<?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=Gunslinger</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=Gunslinger"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Gunslinger"/>
	<updated>2026-04-15T02:42:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35562</id>
		<title>OnClientWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35562"/>
		<updated>2013-04-25T15:59:33Z</updated>

		<summary type="html">&lt;p&gt;Gunslinger: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event will be triggered once a client fires his 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;
element hitElement, float posX,  float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''hitElement:''' the element that was hit&lt;br /&gt;
*'''posX:''' the position it will hit&lt;br /&gt;
*'''posY:''' the position it will hit&lt;br /&gt;
*'''posZ:''' the position it will hit&lt;br /&gt;
*'''normalX:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalY:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalZ:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''materialType:''' the material type it hit ( see processLineOfSight )&lt;br /&gt;
*'''lighting:''' the lighting of the entity it hit ( see processLineOfSight )&lt;br /&gt;
*'''pieceHit:''' the piece of the entity it hit ( see processLineOfSight )&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the weapon that was fired.&lt;br /&gt;
&lt;br /&gt;
==Cancel Effect==&lt;br /&gt;
If this event was [[Event system#Canceling|canceled]], then the show will be canceled.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prevents the player from firing a Deagle.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&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 noDeagle()&lt;br /&gt;
	local weaponID = getElementModel(source) &lt;br /&gt;
	-- Gets the ID of the weapon.&lt;br /&gt;
	if weaponID == 24 then &lt;br /&gt;
		-- If the weapon ID is of the Deagle's then cancel the event.&lt;br /&gt;
		cancelEvent() &lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientWeaponFire&amp;quot;, getRootElement(), noDeagle)&lt;br /&gt;
-- Attach the event 'onClientWeaponFire' to the function.&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;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Gunslinger</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35561</id>
		<title>OnClientWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35561"/>
		<updated>2013-04-25T15:37:55Z</updated>

		<summary type="html">&lt;p&gt;Gunslinger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event will be triggered once a client fires his 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;
element hitElement, float posX,  float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''hitElement:''' the element that was hit&lt;br /&gt;
*'''posX:''' the position it will hit&lt;br /&gt;
*'''posY:''' the position it will hit&lt;br /&gt;
*'''posZ:''' the position it will hit&lt;br /&gt;
*'''normalX:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalY:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalZ:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''materialType:''' the material type it hit ( see processLineOfSight )&lt;br /&gt;
*'''lighting:''' the lighting of the entity it hit ( see processLineOfSight )&lt;br /&gt;
*'''pieceHit:''' the piece of the entity it hit ( see processLineOfSight )&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the weapon that was fired.&lt;br /&gt;
&lt;br /&gt;
==Cancel Effect==&lt;br /&gt;
If this event was [[Event system#Canceling|canceled]], then the show will be canceled.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prevents the player from firing a Deagle.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&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 noDeagle(hitElement)&lt;br /&gt;
	local weaponID = getElementModel(source) &lt;br /&gt;
	-- Gets the ID of the weapon.&lt;br /&gt;
	if weaponID == 24 then &lt;br /&gt;
		-- If the weapon ID is of the Deagle's then cancel the event.&lt;br /&gt;
		cancelEvent() &lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientWeaponFire&amp;quot;, getRootElement(), noDeagle)&lt;br /&gt;
-- Attach the event 'onClientWeaponFire' to the function.&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;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Gunslinger</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35560</id>
		<title>OnClientWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35560"/>
		<updated>2013-04-25T15:35:08Z</updated>

		<summary type="html">&lt;p&gt;Gunslinger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&lt;br /&gt;
This event will be triggered once a client fires his 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;
element hitElement, float posX,  float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''hitElement:''' the element that was hit&lt;br /&gt;
*'''posX:''' the position it will hit&lt;br /&gt;
*'''posY:''' the position it will hit&lt;br /&gt;
*'''posZ:''' the position it will hit&lt;br /&gt;
*'''normalX:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalY:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalZ:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''materialType:''' the material type it hit ( see processLineOfSight )&lt;br /&gt;
*'''lighting:''' the lighting of the entity it hit ( see processLineOfSight )&lt;br /&gt;
*'''pieceHit:''' the piece of the entity it hit ( see processLineOfSight )&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the weapon that was fired.&lt;br /&gt;
&lt;br /&gt;
==Cancel Effect==&lt;br /&gt;
If this event was [[Event system#Canceling|canceled]], then the show will be canceled.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prevents the player from firing a Deagle.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&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 noDeagle(hitElement)&lt;br /&gt;
	local weaponID = getElementModel(source) &lt;br /&gt;
	-- Gets the ID of the weapon.&lt;br /&gt;
	if weaponID == 24 then &lt;br /&gt;
		-- If the weapon ID is of the Deagle's then cancel the event.&lt;br /&gt;
		cancelEvent() &lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientWeaponFire&amp;quot;, getRootElement(), noDeagle)&lt;br /&gt;
-- Attach the event 'onClientWeaponFire' to the function.&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;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Gunslinger</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35559</id>
		<title>OnClientWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35559"/>
		<updated>2013-04-25T15:06:47Z</updated>

		<summary type="html">&lt;p&gt;Gunslinger: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
&lt;br /&gt;
Weapon creation event.&lt;br /&gt;
&lt;br /&gt;
Called post firing so properties can be changed per shot&lt;br /&gt;
&lt;br /&gt;
Source is the weapon that fired&lt;br /&gt;
&lt;br /&gt;
Can be cancelled with cancelEvent to prevent the shot.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element hitElement, float posX,  float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''hitElement:''' the element that was hit&lt;br /&gt;
*'''posX:''' the position it will hit&lt;br /&gt;
*'''posY:''' the position it will hit&lt;br /&gt;
*'''posZ:''' the position it will hit&lt;br /&gt;
*'''normalX:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalY:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalZ:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''materialType:''' the material type it hit ( see processLineOfSight )&lt;br /&gt;
*'''lighting:''' the lighting of the entity it hit ( see processLineOfSight )&lt;br /&gt;
*'''pieceHit:''' the piece of the entity it hit ( see processLineOfSight )&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example calls server events, when an object was hit, or the player shot at something with a special gun.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gunslinger</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35558</id>
		<title>OnClientWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientWeaponFire&amp;diff=35558"/>
		<updated>2013-04-25T15:05:58Z</updated>

		<summary type="html">&lt;p&gt;Gunslinger: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
&lt;br /&gt;
Weapon creation event.&lt;br /&gt;
&lt;br /&gt;
Called post firing so properties can be changed per shot&lt;br /&gt;
&lt;br /&gt;
Source is the weapon that fired&lt;br /&gt;
&lt;br /&gt;
Can be cancelled with cancelEvent to prevent the shot.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element hitElement, float posX,  float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''hitElement:''' the element that was hit&lt;br /&gt;
*'''posX:''' the position it will hit&lt;br /&gt;
*'''posY:''' the position it will hit&lt;br /&gt;
*'''posZ:''' the position it will hit&lt;br /&gt;
*'''normalX:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalY:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''normalZ:''' the normal it hit ( see processLineOfSight )&lt;br /&gt;
*'''materialType:''' the material type it hit ( see processLineOfSight )&lt;br /&gt;
*'''lighting:''' the lighting of the entity it hit ( see processLineOfSight )&lt;br /&gt;
*'''pieceHit:''' the piece of the entity it hit ( see processLineOfSight )&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example calls server events, when an object was hit, or the player shot at something with a special gun.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Gunslinger</name></author>
	</entry>
</feed>