Reference des fonctions
GameMaker Studio · GML · Groups & clans
gmda_listGroups
Browses or searches public groups, ordered by member count (descending).
Asynchronous (result via event)
Signature
gmda_listGroups([search=""], [limit=50]) -> realWhat it does
POSTs /groups/list, then queues groups_listed { success, response }. e.response is the raw server body: the list of group structs (no my_role field), sorted by member_count descending, is the array at e.response.groups. Returns 0 (and queues nothing) when there is no active session.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| search | string | "" | Optional name substring (1-50 chars). Empty lists all groups. |
| limit | real | 50 | Max results, clamped to 1-100. |
How to call it
Call it, then read the array from e.response.groups on the groups_listed event in gmda_pollEvent(). Use the returned group ids with gmda_joinGroup() (open groups) or gmda_createGroupRequest() (request groups).
Result event: groups_listed { success, response }
Example
gmda_listGroups("dra"); // search by name
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "groups_listed" && e.success) {
var groups = e.response.groups; // the list lives at response.groups
for (var i = 0; i < array_length(groups); i++) {
var g = groups[i];
show_debug_message(g.name + " - " + string(g.member_count) + " members");
}
}
e = gmda_pollEvent();
}Use cases
- Show a browseable list of clans the player can join.
- Build a search box so players can find a group by name.