Reference des fonctions
GameMaker Studio · GML · Friends
gmda_cancelInvitation
Cancels an outgoing friend invitation you previously sent.
Asynchronous (result via event)
Signature
gmda_cancelInvitation(invitation_id) -> realWhat it does
POSTs /friends/invitations/cancel. Returns 1 when fired, 0 with no active session. Only the player who sent the invitation can cancel it; on success the invitation_cancelled event reports response.status "cancelled". On failure success is false (not found, not yours, or no longer pending).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| invitation_id | string | required | The id of an outgoing invitation (only the sender may cancel it). |
How to call it
Fire gmda_cancelInvitation(), then read invitation_cancelled from gmda_pollEvent(). Use an id from the outgoing batch of gmda_listPendingInvitations().
Result event: invitation_cancelled { success, response }
Example
gmda_cancelInvitation(invitation_id);
// In the Step event:
var _e = gmda_pollEvent();
while (!is_undefined(_e)) {
if (_e.event == "invitation_cancelled") {
if (_e.success) show_debug_message("cancelled");
else show_debug_message("cancel failed: " + string(_e.error));
}
_e = gmda_pollEvent();
}Use cases
- Let a player retract a friend request from their outgoing list.
- Clean up a duplicate or mistaken invite before it's answered.