ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPedArmor

Function

setPedArmor

ServerPedsIdentical to MTA:SA

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