Squirrel/Client/Events/Player/onClientArmourChange
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|onClientArmourChange}} This is called when the clients Armour changes. == Syntax == <code lang="squirrel">function onClientArmourChange( int iOldArmour, int iN…') |
(Fixed example) |
||
Line 1: | Line 1: | ||
{{Squirrel/Title|onClientArmourChange}} | {{Squirrel/Title|onClientArmourChange}} | ||
− | This is called when the clients | + | This is called when the clients armour changes. |
== Syntax == | == Syntax == | ||
− | <code | + | <code>function onClientArmourChange( int iOldArmour, int iNewArmour )</code> |
=== Arguments === | === Arguments === | ||
Line 13: | Line 13: | ||
=== Returns === | === Returns === | ||
− | + | This event does not handle return values. | |
− | + | ||
== Example == | == Example == | ||
Line 20: | Line 19: | ||
This example will Message the player when their cash changes | This example will Message the player when their cash changes | ||
− | |||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function onClientArmourChange( iOldArmour, iNewArmour ) { | + | function onClientArmourChange( iOldArmour, iNewArmour ) |
− | + | { | |
− | + | Message( "You have: " + pPlayer.Armour + " Armour remaining" ); | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 32: | Line 31: | ||
− | The functions [[Squirrel/ | + | The functions [[Squirrel/Client/Functions/Messages/Message|Message]] and [[Squirrel/Client/Functions/Players/Armour|Player.Armour]] were used in this example. More info about them can be found in the corresponding pages. |
+ | |||
== Related Events == | == Related Events == | ||
{{Squirrel/Client/Events/Player}} | {{Squirrel/Client/Events/Player}} |
Revision as of 18:54, 14 April 2011
This is called when the clients armour changes.
Syntax
function onClientArmourChange( int iOldArmour, int iNewArmour )
Arguments
- iOldArmour - The player's Old Armour Value
- iNewArmour - The player's New Armour Value
Returns
This event does not handle return values.
Example
This example will Message the player when their cash changes
function onClientArmourChange( iOldArmour, iNewArmour ) { Message( "You have: " + pPlayer.Armour + " Armour remaining" ); return 1; }
Notes
The functions Message and Player.Armour were used in this example. More info about them can be found in the corresponding pages.
Related Events
- onClientArmourChange
- onClientCashChange
- onClientCollideWithPlayer
- onClientCommand
- onClientDeath
- onClientFall
- onClientHealthChange
- onClientHurt
- onClientKill
- onClientKeyStateChange
- onClientRequestClass
- onClientRequestSpawn
- onClientShot
- onClientSpawn
- onClientUseDetonator
- onClientWeaponChange
- onPlayerDeath
- onPlayerJoin
- onPlayerKill
- onPlayerPart
- onPlayerSpawn