GetPlayerTotalAmmo
Jump to navigation
Jump to search
This article needs checking. | |
Reason(s): Should return false instead of 0 if player's invalid, for consistency |
This function returns an integer that contains the total ammo in a specified player's weapon. See Weapon Info
Syntax
Click to expand [+]
ServerClick to expand [+]
ClientExample
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
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState