- Documentation
- Server functions
- setPedArmor
Function
setPedArmor
Sets 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 as setPlayerArmour.
Syntax
bool setPedArmor(ped ped, float armor)Arguments
pedped- A player or an NPC.
armorfloat- New armour from 0 (none) to 100 (full vest).
Returns
true on success.
Example
addEventHandler("onPlayerSpawn", root, function()
setPedArmor(source, 50)
end)
See also
getPedArmorReturns 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.setElementHealthSets an element's health.0kills a player or ped and firesonPlayerWasted/onPedWasted.