Squirrel/Client/Functions/Players/Health

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
Line 13: Line 13:
 
function onPlayerCommand( player, cmd, text )
 
function onPlayerCommand( player, cmd, text )
 
{
 
{
if ( cmd== "health" )
+
if ( cmd == "health" )
 
{
 
{
player.Health = 100;
+
player.Health = 100;
                MessagePlayer( "[#00ff00]*System* [#ff0000]Your health is " + player.Health + ".", player);
+
        MessagePlayer( "[#00ff00]*System* [#ff0000]Your health is " + player.Health + ".", player);
 
}
 
}
 
}
 
}

Revision as of 14:36, 10 August 2013

Contents

Syntax

  1. float player.Health
  1. player.Health = float value

Arguments

  • value - What you can set the health value to.

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "health" )
  5. {
  6. player.Health = 100;
  7. MessagePlayer( "[#00ff00]*System* [#ff0000]Your health is " + player.Health + ".", player);
  8. }
  9. }
  10.  

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.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox