getPedArmor | Multi Theft Auto: Wiki Skip to content

getPedArmor

Client-side
Server-side
Shared

Pair: setPedArmor

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns the current armor of the specified ped.

OOP Syntax Help! I don't understand this!

  • Method:ped:getArmor(...)
  • Variable: .armor

Syntax

float getPedArmor ( ped thePed )
Required Arguments
  • thePed: The ped whose armor you want to check

Returns

  • float: value

A float with the armor, false if an invalid ped was given.

Code Examples

shared

This example defines a "showarmor" console command that shows the player that executes it how much armor he has.

function showArmor ( )
local armor = getPedArmor ( localPlayer )
outputChatBox( "Your armor: " .. armor )
end
addCommandHandler ( "showarmor", showArmor )

See Also