Functions Reference
GameMaker Studio · GML · Friends
gmda_listFriends
Lists the player's accepted friends, newest friendship first, with optional name search.
Asynchronous (result via event)
Signature
gmda_listFriends([limit=100], [search=""]) -> realWhat it does
POSTs /friends/list. Returns 1 when fired, 0 with no active session. The friends_loaded event carries response.friends, an array of ACCEPTED friendships newest first; each entry is a struct { player_key, player_name, friends_since } (friends_since is the ISO timestamp the friendship was created). The array is empty when the player has no friends.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| limit | real | 100 | Maximum friends to return (clamped client-side to 1..200). |
| search | string | "" | Optional case-insensitive substring match on player_name. |
How to call it
Fire gmda_listFriends(), then read friends_loaded from gmda_pollEvent(). Pass a search string to filter a long list by name.
Result event: friends_loaded { success, response }
Example
gmda_listFriends(); // or gmda_listFriends(50, "text")
// In the Step event:
var _e = gmda_pollEvent();
while (!is_undefined(_e)) {
if (_e.event == "friends_loaded" && _e.success) {
var _friends = _e.response.friends;
for (var _i = 0; _i < array_length(_friends); _i++) {
var _f = _friends[_i];
show_debug_message(_f.player_name + " (since " + _f.friends_since + ")");
}
}
_e = gmda_pollEvent();
}Use cases
- Render the player's friends list in a social menu.
- Search a long friends list by typing part of a name.