Squirrel/Server/Functions/HashTables/Dec
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ == Syntax == <code>HashTable.Dec( data )</code> <code>HashTable.Dec( data, int Amount )</code> == Arguments == * ''' data ''' - The value that you wish to decrease. * ''' Amo...) |
(→Notes) |
||
Line 24: | Line 24: | ||
=== Notes === | === Notes === | ||
− | The function [[Squirrel/Server/Events/Player/onPlayerDeath|onPlayerDeath]] and [[Squirrel/Server/Functions/Players/Name|Player.Name]] were used in this example, more info about | + | The function [[Squirrel/Server/Events/Player/onPlayerDeath|onPlayerDeath]] and [[Squirrel/Server/Functions/Players/Name|Player.Name]] were used in this example, more info about them in the corresponding page. |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/HashTables}} | {{Squirrel/Server/Functions/HashTables}} |
Revision as of 02:05, 26 May 2010
Syntax
HashTable.Dec( data )
HashTable.Dec( data, int Amount )
Arguments
- data - The value that you wish to decrease.
- Amount - How much you wish to decrease the amount by (optional - default is 1)
Example
function onPlayerDeath( pPlayer ) { pDataHash.Dec( pPlayer.Name + ".Cash", 500 ); }
This example will decrease the value of the stored cash amount by 500.
Notes
The function onPlayerDeath and Player.Name were used in this example, more info about them in the corresponding page.