FBInstant.player.getStatsAsync: Difference between revisions
From GiderosMobile
No edit summary |
m Text replacement - "</source>" to "</syntaxhighlight>" |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros 2018.3<br/> | <languages /> | ||
=== Description === | '''<translate>Available since</translate>:''' Gideros 2018.3<br/> | ||
<br /> | '''<translate>Class</translate>:''' [[Special:MyLanguage/Player|Player]]<br/> | ||
=== <translate>Description</translate> === | |||
<translate><br /> | |||
Retrieve stats from the designated cloud storage of the current player.<br /> | Retrieve stats from the designated cloud storage of the current player.<br /> | ||
<br /> | <br /></translate> | ||
< | <syntaxhighlight lang="lua"> | ||
FBInstant.player.getStatsAsync(keys,callback) | FBInstant.player.getStatsAsync(keys,callback) | ||
</ | </syntaxhighlight> | ||
'''keys''': (table) An optional table of unique keys to retrieve stats for. If the function is called with it nil, it will fetch all stats. | === <translate>Parameters</translate> === | ||
'''callback''': (function) A function that will be called with two arguments: a set of key-value pairs or nil is the operation failed, and an error code if the function failed. ''''''<br/> | '''keys''': (table) <translate>An optional table of unique keys to retrieve stats for. If the function is called with it nil, it will fetch all stats.</translate> <br/> | ||
'''callback''': (function) <translate>A function that will be called with two arguments: a set of key-value pairs or nil is the operation failed, and an error code if the function failed.</translate> <br/> | |||
=== <translate>Examples</translate> === | |||
'''Example'''<br/> | |||
<syntaxhighlight lang="lua"> | |||
FBInstant.player.getDataAsync({"level","zombiesSlain"}, function(result,error) | |||
if result then | |||
print("stats are loaded") | |||
for key,value in pairs(result) do | |||
print(key,value) | |||
end | |||
end | |||
end) | |||
<br/></syntaxhighlight> | |||
{{FBInstant.player}} | |||
Latest revision as of 13:29, 13 July 2023
Available since: Gideros 2018.3
Class: Player
Description
Retrieve stats from the designated cloud storage of the current player.
FBInstant.player.getStatsAsync(keys,callback)
Parameters
keys: (table) An optional table of unique keys to retrieve stats for. If the function is called with it nil, it will fetch all stats.
callback: (function) A function that will be called with two arguments: a set of key-value pairs or nil is the operation failed, and an error code if the function failed.
Examples
Example
FBInstant.player.getDataAsync({"level","zombiesSlain"}, function(result,error)
if result then
print("stats are loaded")
for key,value in pairs(result) do
print(key,value)
end
end
end)
<br/>
- FBInstant.player.canSubscribeBotAsync
- FBInstant.player.flushDataAsync
- FBInstant.player.getConnectedPlayersAsync
- FBInstant.player.getDataAsync
- FBInstant.player.getID
- FBInstant.player.getName
- FBInstant.player.getPhoto
- FBInstant.player.getSignedPlayerInfoAsync
- FBInstant.player.getStatsAsync
- FBInstant.player.incrementStatsAsync
- FBInstant.player.setDataAsync
- FBInstant.player.setStatsAsync
- FBInstant.player.subscribeBotAsync