GetPlayerArmor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (Visual improvement)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{Deprecated}}
{{DeprecatedWithAlt|getPedArmor|}}
 
Please use [[getPedArmor]]


This function returns a float that contains the current armor for the specified [[player]].
This function returns a float that contains the current armor for the specified [[player]].

Revision as of 14:25, 25 June 2014

Template:DeprecatedWithAlt

This function returns a float that contains the current armor for the specified player.

Syntax

float getPlayerArmor ( player thePlayer )

Required Arguments

  • thePlayer: The player whose armor you want to check

Returns

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

Example

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

Click to collapse [-]
Client
function showArmor ( )
	local me = getLocalPlayer ( )
	local armor = getPlayerArmor ( me )
	outputChatBox( "Your armor: " .. armor, me )
end
addCommandHandler ( "showarmor", showArmor )

See Also