SetPlayerArmor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Needs_Checking|Is Armor an int or a float? What is the maximum Armor value?|[[User:Vandalite|Vandalite]]}}
==Description==
==Description==
This function allows you to set the armor value of a player. This function will return false if an invalid player is specified, or the armor value specified is out of acceptable range.
This function allows you to set the armor value of a player. This function will return false if an invalid player is specified, or the armor value specified is out of acceptable range.
Line 10: Line 9:
===Required Arguments===
===Required Arguments===
*'''player''': the [[player]] whose armor you want to modify
*'''player''': the [[player]] whose armor you want to modify
*'''armor''': the amount of armor you want to set on the player.
*'''armor''': the amount of armor you want to set on the player. Valid values are from 0 to 100


==Example==
==Example==

Revision as of 01:22, 30 March 2006

Description

This function allows you to set the armor value of a player. This function will return false if an invalid player is specified, or the armor value specified is out of acceptable range.

Syntax

bool setPlayerArmor ( player player, float armor )

Required Arguments

  • player: the player whose armor you want to modify
  • armor: the amount of armor you want to set on the player. Valid values are from 0 to 100

Example

if ( setPlayerArmor ( findPlayer ( "SomeGuy" ), 0 ) ) then
  serverChat ( "Sorry Someguy, no armor for you! " )
end