Squirrel/Client/Functions/Players/Health
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with "== Syntax == <code>float player.Health</code> <code>player.Health = float value</code> == Arguments == * '''value''' - What you can set the health value to. == Example == ...") |
(→Example) |
||
Line 16: | Line 16: | ||
{ | { | ||
player.Health = 100; | player.Health = 100; | ||
− | MessagePlayer( "*System* Your health is " + player.Health + ".", player); | + | MessagePlayer( "[#00ff00]*System* [#ff0000]Your health is " + player.Health + ".", player); |
} | } | ||
} | } |
Revision as of 14:35, 10 August 2013
Contents |
Syntax
float player.Health
player.Health = float value
Arguments
- value - What you can set the health value to.
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd== "health" ) { player.Health = 100; MessagePlayer( "[#00ff00]*System* [#ff0000]Your health is " + player.Health + ".", player); } }
This will heal the player when He use /health.
Notes
The call onPlayerCommand and MessagePlayer were used in in this example. More info about them in the corresponding page.