getPedAmmoInClip | Multi Theft Auto: Wiki Skip to content

getPedAmmoInClip

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function returns an integer that contains the ammo in a specified ped's weapon. See Weapon Info

Syntax

getPedAmmoInClip ( )

Code Examples

server

This example outputs the amount of ammo the specified player has in his current slot. For example: 'ammo someguy'.

function showAmmo(thePlayer, command, who )
local targetPlayer = getPlayerFromName ( who )
if ( thePlayer ) then
local ammo = getPedAmmoInClip ( targetPlayer )
outputChatBox ( who .. " has " .. ammo .. " ammo in his active clip" )
else
outputChatBox ( "Player '" .. who .. "' not found." )
end
end
addCommandHandler( "ammo", showAmmo )

Issues

ID Description
734 Sometimes wrong count of player ammo, if get it in onPlayerWeaponFire

See Also