Referencia de funciones
GameMaker Studio · GML · Players
gmda_loadPlayerInfo
Loads another player's public profile and their best scores by their player key.
Asynchronous (result via event)
Signature
gmda_loadPlayerInfo(player_key) -> realWhat it does
POSTs /players/info with the given player_key. The queued player_info_loaded event carries response, a struct holding player (the public profile fields) and scores (an array with one entry per leaderboard table the player has a best score on).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player_key | string | required | The target player's key (for example from a search result or a friends list). |
How to call it
Returns 1 once the request is queued, or 0 immediately if there is no active session. Read the result from the event queue: poll for an event whose event field is "player_info_loaded".
Result event: player_info_loaded { success, response }
Example
gmda_loadPlayerInfo(target_key);
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "player_info_loaded" && e.success) {
var p = e.response.player;
var scores = e.response.scores;
show_debug_message(p.player_name + " has " + string(array_length(scores)) + " ranked scores");
}
e = gmda_pollEvent();
}Use cases
- Show another player's profile after picking them from search results.
- Display a friend's best scores across your leaderboard tables.