Functions Reference
GameMaker Studio · GML · Groups & clans
gmda_joinGroup
Directly joins an OPEN group.
Asynchronous (result via event)
Signature
gmda_joinGroup(group_id) -> realWhat it does
POSTs /groups/join, then queues group_joined { success, response }. Works only for open groups; for request or invite_only groups use gmda_createGroupRequest() instead. On failure e.error carries the raw server message, e.g. "This group is not open to join", "Group is full", "You are already in a group", or "Group not found".
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| group_id | string | required | Id of the group to join. Must be a group whose join_policy is "open". |
How to call it
Call it, then read group_joined from gmda_pollEvent(). For non-open groups this fails with "This group is not open to join"; use gmda_createGroupRequest().
Result event: group_joined { success, response }
Example
gmda_joinGroup(group_id); // open groups only
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "group_joined") {
if (e.success) show_debug_message("Joined the group");
else show_debug_message("Failed: " + e.error); // e.g. "This group is not open to join"
}
e = gmda_pollEvent();
}Use cases
- Let a player join an open clan with one tap.
- Wire up a 'Join' button on each open group in the browse list.