GetPlayerTotalAmmo
Jump to navigation
Jump to search
This function returns an integer that contains the total ammo in a specified player's weapon. See Weapon Info
Syntax
int getPlayerTotalAmmo ( player thePlayer, [ int weaponSlot = current ] )
Required Arguments
- thePlayer: The player whose ammo you want to check.
Optional Arguments
- weaponSlot: an integer representing the weapon slot (set to the players current slot if not given)
Returns
Returns an int containing the total amount of ammo for the specified player's weapon, or 0 if the player specified is invalid.
Example
This example outputs the total amount of ammo a player called Someguy has for his weapon.
-- Find the player called 'Someguy' myPlayer = findPlayer ( "Someguy" ) -- If a player called 'Someguy' was found then if ( myPlayer ~= false ) -- Retrieve the total amount of ammo for that player, and store it in a variable called 'ammo' ammo = getPlayerTotalAmmo ( myPlayer ) -- Tell all the players how much ammo 'Someguy' has outputChatBox ( "Someguy's current total ammo: ", ammo, "." ) end
See Also
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerScriptDebugLevel
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- setPlayerScriptDebugLevel
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerMoney
- takePlayerScreenShot