GetPedArmor

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function returns the current armor of the specified ped.

Syntax

float getPedArmor ( ped thePed )

OOP Syntax Help! I don't understand this!

Method: ped:getArmor(...)
Variable: .armor
Counterpart: setPedArmor


Required Arguments

  • thePed: The ped whose armor you want to check

Returns

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

Example

Click to collapse [-]
Client

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