GetPlayerAmmoInClip
Jump to navigation
Jump to search
This function returns an integer that contains the current ammo in a specified player's current weapon.
Syntax
int getPlayerAmmoInClip ( player thePlayer )
Required Arguments
- thePlayer: The player whose ammo you want to check.
Returns
Returns an int containing the ammount of ammo in the specified player's clip, or 0 if the player specified is invalid.
Example
This example outputs the ammount of ammo a player called Someguy has in his weapon's clip.
-- Find the player called 'Someguy' myPlayer = findPlayer ( "Someguy" ) -- If a player called 'Someguy' was found then if ( myPlayer ~= false ) -- Retrieve the ammount of ammo in the clip for that player, and store it in a variable called 'ammo' ammo = getPlayerAmmoInClip ( myPlayer ) -- Tell all the players how much ammo 'Someguy' has outputChatBox ( "Someguy's current ammo-in-clip: ", 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