Squirrel/Client/Events/Player/onClientHealthChange
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|onClientHealthChange}} This is called when the clients Health changes. == Syntax == <code lang="squirrel">function onClientHealthChange( int iOldHealth, int iN…') |
|||
Line 1: | Line 1: | ||
{{Squirrel/Title|onClientHealthChange}} | {{Squirrel/Title|onClientHealthChange}} | ||
− | This is called when the clients | + | This is called when the clients health changes. |
== Syntax == | == Syntax == | ||
− | <code | + | <code>function onClientHealthChange( int oldhp, int newhp )</code> |
=== Arguments === | === Arguments === | ||
− | * ''' | + | * '''oldhp''' - The player's old health |
− | * ''' | + | * '''newhp''' - The player's new health |
=== Returns === | === Returns === | ||
− | + | This event does not handle return values. | |
− | + | ||
== Example == | == Example == | ||
− | This example will | + | This example will message the player when their health changes |
− | |||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function onClientHealthChange( | + | function onClientHealthChange( oldhp, newhp ) |
− | + | { | |
− | + | Message( "You have: " + newhp + " health remaining" ); | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 31: | Line 30: | ||
=== Notes === | === Notes === | ||
+ | The function [[Squirrel/Client/Functions/Messages/Message|Message]] was used in this example. More info about it can be found in the corresponding page. | ||
− | |||
== Related Events == | == Related Events == | ||
{{Squirrel/Client/Events/Player}} | {{Squirrel/Client/Events/Player}} |
Latest revision as of 19:46, 14 April 2011
This is called when the clients health changes.
[edit] Syntax
function onClientHealthChange( int oldhp, int newhp )
[edit] Arguments
- oldhp - The player's old health
- newhp - The player's new health
[edit] Returns
This event does not handle return values.
[edit] Example
This example will message the player when their health changes
function onClientHealthChange( oldhp, newhp ) { Message( "You have: " + newhp + " health remaining" ); return 1; }
[edit] Notes
The function Message was used in this example. More info about it can be found in the corresponding page.
[edit] Related Events
- onClientArmourChange
- onClientCashChange
- onClientCollideWithPlayer
- onClientCommand
- onClientDeath
- onClientFall
- onClientHealthChange
- onClientHurt
- onClientKill
- onClientKeyStateChange
- onClientRequestClass
- onClientRequestSpawn
- onClientShot
- onClientSpawn
- onClientUseDetonator
- onClientWeaponChange
- onPlayerDeath
- onPlayerJoin
- onPlayerKill
- onPlayerPart
- onPlayerSpawn