SetPlayerHealth
From SA-MP Wiki
(Difference between revisions)
Revision as of 16:26, 9 July 2013 Drebin (Talk | contribs) (These are not tips, they are notes.) ← Previous diff |
Revision as of 21:36, 1 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|Set the health level of a player.}} | {{Description|Set the health level of a player.}} | ||
Line 40: | Line 39: | ||
[[Category:Scripting_Functions]] | [[Category:Scripting_Functions]] | ||
- | [[ru:SetPlayerHealth]] | ||
[[de:SetPlayerHealth]] | [[de:SetPlayerHealth]] | ||
+ | [[fr:SetPlayerHealth]] | ||
+ | [[ru:SetPlayerHealth]] |
Revision as of 21:36, 1 February 2014
Description:
Set the health level of a player.
(playerid, health)
playerid | The ID of the player to set the health of. |
health | The value to set the player's health to. |
Return Values:
This function does not return any specific values.
//Sets the players health to full public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp("/heal", cmdtext, true)) { SetPlayerHealth(playerid, 100); return 1; } if(!strcmp("/kill", cmdtext, true)) { SetPlayerHealth(playerid, 0); return 1; } return 0; }
Notes |
|
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetPlayerHealth: Find out how much health a player has.
- GetPlayerArmour: Find out how much armour a player has.
- SetPlayerArmour: Set the armour of a player.