SetPlayerHealth

From Multi Theft Auto: Wiki
Revision as of 08:37, 29 March 2006 by Vandalite (talk | contribs)
Jump to navigation Jump to search


Dialog-information.png This article needs checking.

Reason(s): Is health an int or a float? What is the maximum Health?

Description

This function allows you to set a player's health directly. It may return false if the player object is invalid, or the health argument is out of range.

Syntax

bool setPlayerHealth ( player player, float health )

Required Arguments

  • player: The player whose health you want to set
  • health: The value you want to set the health to.

Example

if ( setPlayerHealth ( findPlayer ( "Someguy" ), 1 ) ) then
  serverChat ( "Someguy's life expectancy just got a lot less expected." )
end