- Documentation
- Shared functions
- getPedArmor
Function
getPedArmor
Returns a ped's armour (body vest) on a 0-100 scale. Armour absorbs damage before health, so a ped with full armour survives roughly twice as many shots. On the server the value comes from the last state sent by the player's game; on the client it is read straight from the game.
Syntax
float getPedArmor(ped ped)Arguments
pedped- A player or an NPC.
Returns
Armour 0-100, or false on a bad argument.
Example
addCommandHandler("pancerz", function(player)
outputChatBox("Twój pancerz: " .. math.floor(getPedArmor(player)), player)
end)
See also
setPedArmorSets a ped's armour (body vest) on a 0-100 scale. The value goes straight to the player's game, so the armour bar on screen changes immediately. Values outside the range are clamped to 0-100. This is the same function assetPlayerArmour.getElementHealthReturns an element's health: peds 0-100 (up to 176 with full stamina), vehicles 0-1000 (below 250 it burns).