Squirrel/Server/Functions/Players/Health
From Liberty Unleashed Wiki
(Difference between revisions)
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>float | + | <code>float player.Health</code> |
+ | <code>player.Health = float value</code> | ||
== Arguments == | == Arguments == | ||
− | * ''' | + | * '''value''' - What you can set the health value to. |
== Example 1. Returning == | == Example 1. Returning == |
Latest revision as of 11:45, 15 October 2010
This function sets/returns the players health.
[edit] Syntax
float player.Health
player.Health = float value
[edit] Arguments
- value - What you can set the health value to.
[edit] Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd== "health" ) { MessagePlayer( "Your health is " + player.Health + ".", player); } }
This will tell the player what their health value currently is.
[edit] Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd== "heal" ) { player.Health = 100; } }
This will heal the player whenever they use /heal.
[edit] Notes
The call onPlayerCommand and MessagePlayer were used in in this example. More info about them in the corresponding page.
[edit] Related Functions
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState