Referência de funções
GameMaker Studio · GML · Friends
gmda_removeFriend
Removes an existing friendship by player key.
Asynchronous (result via event)
Signature
gmda_removeFriend(player_key) -> realWhat it does
POSTs /friends/remove. Returns 1 when fired, 0 with no active session. On success the friend_removed event reports response.removed true. On failure success is false (they aren't actually a friend, or the player was not found).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player_key | string | required | The key of the friend to remove. |
How to call it
Fire gmda_removeFriend(), then read friend_removed from gmda_pollEvent(). Use a player_key from a gmda_listFriends() entry.
Result event: friend_removed { success, response }
Example
gmda_removeFriend(player_key);
// In the Step event:
var _e = gmda_pollEvent();
while (!is_undefined(_e)) {
if (_e.event == "friend_removed") {
if (_e.success) show_debug_message("friend removed");
else show_debug_message("remove failed: " + string(_e.error));
}
_e = gmda_pollEvent();
}Use cases
- Unfriend button on a friend's row in the social menu.
- Let a player prune their friends list.