ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getPedArmor

Function

getPedArmor

Server and clientPedsIdentical to MTA:SA

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