Difference between revisions of "FBInstant.player.incrementStatsAsync"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.3<br/> === Description === <br /> Increment stats saved in the designated cloud storage of the current player.<br /> <br /> <sour...")
 
Line 6: Line 6:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
= FBInstant.player.incrementStatsAsync(keys-value-pairscallback,)
+
FBInstant.player.incrementStatsAsync(keys-value-pairs,callback)
 
</source>
 
</source>
'''keys-value-pairs:''' (table) A table containing a set of key-value pairs  indicating how much to increment each stat in cloud storage.  The object must contain only numerical values - any non-numerical values will cause the entire modification to be rejected. ''''''<br/>
+
'''keys-value-pairs''': (table) A table containing a set of key-value pairs  indicating how much to increment each stat in cloud storage.  The object must contain only numerical values - any non-numerical values will cause the entire modification to be rejected. ''''''<br/>
'''callback:''' (function) A function that will be called with two arguments: a table which contains the updated key-value pairs for each key specified in the input dictionary or nil if the operation failed, and an error code if the function failed.  NOTE: The table does not necessarily mean that the changes have already been persisted. Rather, it means that the increments were valid and have been scheduled to be performed. It also guarantees that all values that were incremented are now available in player.getStatsAsync. ''''''<br/>
+
'''callback''': (function) A function that will be called with two arguments: a table which contains the updated key-value pairs for each key specified in the input dictionary or nil if the operation failed, and an error code if the function failed.  NOTE: The table does not necessarily mean that the changes have already been persisted. Rather, it means that the increments were valid and have been scheduled to be performed. It also guarantees that all values that were incremented are now available in player.getStatsAsync. ''''''<br/>

Revision as of 10:16, 23 August 2018

Available since: Gideros 2018.3

Description


Increment stats saved in the designated cloud storage of the current player.

 FBInstant.player.incrementStatsAsync(keys-value-pairs,callback)

'keys-value-pairs: (table) A table containing a set of key-value pairs indicating how much to increment each stat in cloud storage. The object must contain only numerical values - any non-numerical values will cause the entire modification to be rejected. '
'callback: (function) A function that will be called with two arguments: a table which contains the updated key-value pairs for each key specified in the input dictionary or nil if the operation failed, and an error code if the function failed. NOTE: The table does not necessarily mean that the changes have already been persisted. Rather, it means that the increments were valid and have been scheduled to be performed. It also guarantees that all values that were incremented are now available in player.getStatsAsync. '