<?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=Dazee</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=Dazee"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Dazee"/>
	<updated>2026-04-07T18:43:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAmmoInClip&amp;diff=43964</id>
		<title>GetPedAmmoInClip</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAmmoInClip&amp;diff=43964"/>
		<updated>2015-01-12T12:18:08Z</updated>

		<summary type="html">&lt;p&gt;Dazee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns an integer that contains the ammo in a specified [[ped]]'s weapon. See [[weapon|Weapon Info]]&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getPedAmmoInClip ( ped thePed [, int weaponSlot = current ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' The [[ped]] whose ammo you want to check.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''weaponSlot:''' an integer representing the weapon slot (set to the ped's currently selected slot if not specified).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[int]] containing the amount of ammo in the specified ped's currently selected or specified clip, or 0 if the ped specified is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs the amount of ammo the specified player has in his current slot. For example: 'ammo someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showAmmo(thePlayer, command, who )&lt;br /&gt;
	local targetPlayer = getPlayerFromName ( who )&lt;br /&gt;
	if ( thePlayer ) then&lt;br /&gt;
		local ammo = getPedAmmoInClip ( targetPlayer )&lt;br /&gt;
		outputChatBox ( who .. &amp;quot; has &amp;quot; .. ammo .. &amp;quot; ammo in his active clip&amp;quot; )&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;Player '&amp;quot; .. who .. &amp;quot;' not found.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;ammo&amp;quot;, showAmmo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;/div&gt;</summary>
		<author><name>Dazee</name></author>
	</entry>
</feed>