Squirrel/Server/Functions/Players/Health
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|Player.Health}} | |
This function sets/returns the players health. | This function sets/returns the players health. | ||
Revision as of 10:32, 11 October 2010
This function sets/returns the players health.
Syntax
float Player.Health( int Value )
Arguments
- Value - What you can set the health value to.
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.
Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd== "heal" ) { player.Health = 100; } }
This will heal the player whenever they use /heal.
Notes
The call onPlayerCommand and MessagePlayer were used in in this example. More info about them in the corresponding page.
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