Referencia de funciones
GameMaker Studio · GML · Players
gmda_setInvitability
Sets whether other players are allowed to send this player friend invites.
Asynchronous (result via event)
Signature
gmda_setInvitability(is_invitable) -> realWhat it does
Sets THIS player's own is_invitable flag (PATCH /players/invitability, session-auth). The queued invitability_changed event carries success and response, the server payload reflecting the saved state. On failure success is false and the event also carries error.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| is_invitable | bool | required | true to allow others to send friend invitations to this player, false to stop receiving them. |
How to call it
Returns 1 once the request is queued, or 0 immediately if there is no active session. Read the outcome from the event queue.
Result event: invitability_changed { success, response }
Example
gmda_setInvitability(false);
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "invitability_changed") {
if (e.success) show_debug_message("invitability updated");
else show_debug_message("could not update invitability");
}
e = gmda_pollEvent();
}Use cases
- Let the player turn friend invitations on or off in a privacy setting.
- Disable incoming invites while the player wants to be left alone.