SetPlayerHealth: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(14 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Needs_Checking|Is health an int or a float? What is the maximum Health?|[[User:Vandalite|Vandalite]]}}
{{Server client function}}
==Description==
{{Deprecated|setElementHealth|}}
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

Latest revision as of 22:24, 1 July 2019

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use setElementHealth instead.