GetPlayerAmmoInClip: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
m (Changed "DeprecatedWithAlt" template to "Deprecated") |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server client function}} | {{Server client function}} | ||
{{Deprecated|getPedAmmoInClip|}} | |||
This function returns an integer that contains the ammo in a specified [[player]]'s weapon. See [[weapon|Weapon Info]] | This function returns an integer that contains the ammo in a specified [[player]]'s weapon. See [[weapon|Weapon Info]] | ||
Latest revision as of 16:24, 13 February 2015
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use getPedAmmoInClip instead. |
This function returns an integer that contains the ammo in a specified player's weapon. See Weapon Info
Syntax
Click to collapse [-]
Serverint getPlayerAmmoInClip ( player thePlayer )
Required Arguments
- thePlayer: The player whose ammo you want to check.
Returns
Returns an int containing the amount of ammo in the player's currently selected clip, or 0 if the player specified is invalid.
Click to collapse [-]
Clientint getPlayerAmmoInClip ( player thePlayer, int weaponSlot )
Required Arguments
- thePlayer: The player whose ammo you want to check.
- weaponSlot: an integer representing the weapon slot.
Returns
Returns an int containing the amount of ammo in the specified player's currently selected or specified clip, or 0 if the player specified is invalid.
Example
Click to collapse [-]
ServerThis 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 = getPlayerFromNick ( who ) if ( thePlayer ) then local ammo = getPlayerAmmoInClip ( targetPlayer ) outputChatBox ( who .. " has " .. ammo .. " ammo in his active clip", thePlayer ) else outputChatBox ( "Player '" .. who .. "' not found.", thePlayer ) end end addCommandHandler( "ammo", showAmmo )
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