Squirrel/Server/Functions/HashTables/Dec
From Liberty Unleashed Wiki
(Difference between revisions)
(→Notes) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|HashTable.Dec}} | |
== Syntax == | == Syntax == |
Latest revision as of 10:25, 11 October 2010
[edit] Syntax
HashTable.Dec( data )
HashTable.Dec( data, int Amount )
[edit] Arguments
- data - The value that you wish to decrease.
- Amount - How much you wish to decrease the amount by (optional - default is 1)
[edit] Example
function onPlayerDeath( pPlayer ) { pDataHash.Dec( pPlayer.Name + ".Cash", 500 ); }
This example will decrease the value of the stored cash amount by 500.
[edit] Notes
The function onPlayerDeath and Player.Name were used in this example, more info about them in the corresponding page.