Referencia de funciones
GameMaker Studio · GML · Groups & clans
gmda_respondGroupInvitation
Accepts or declines a group invitation addressed to the caller.
Asynchronous (result via event)
Signature
gmda_respondGroupInvitation(invitation_id, accept_bool) -> realWhat it does
POSTs /groups/invitations/respond, then queues group_invitation_responded { success, response }. response carries status ("accepted" | "declined") and, on accept, the group_id. On failure e.error carries the raw server message, e.g. "Invitation is not pending", "Invitation expired", "You are already in a group", "Group is full", or "Invitation not found".
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| invitation_id | string | required | Id of the invitation to respond to. |
| accept_bool | bool | required | true to accept (join the group), false to decline. |
How to call it
Call it, then read group_invitation_responded from gmda_pollEvent(). Only the invitee may respond; get ids from gmda_listGroupInvitations("incoming").
Result event: group_invitation_responded { success, response }
Example
gmda_respondGroupInvitation(invitation_id, true); // accept
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "group_invitation_responded" && e.success) {
if (e.response.status == "accepted") show_debug_message("Joined " + e.response.group_id);
}
e = gmda_pollEvent();
}Use cases
- Wire Accept / Decline buttons on an invite card.
- Auto-join the player into the group once they accept.