HU/getPedArmor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function returns the current armor of the specified ped. ==Syntax== <syntaxhighlight lang="lua">float getPedArmor ( ped thePed )...")
 
Line 27: Line 27:


==See Also==
==See Also==
{{Ped functions}}
{{Ped functions hu}}


[[en:getPedArmor]]
[[en:getPedArmor]]

Revision as of 17:24, 29 September 2018

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 me = getLocalPlayer ( )
	local armor = getPedArmor ( me )
	outputChatBox( "Your armor: " .. armor )
end
addCommandHandler ( "showarmor", showArmor )

See Also