1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.


An API to manage a friend list

Total Downloads: 21,863 - First Release: Oct 26, 2014 - Last Update: Nov 10, 2017

5/5, 39 likes
  1. Wulf
    This plugin doesn't do anything itself besides managing a friends list. It offers functions to use by other plugins to do things based on players friends.

    Usage for players

    /friend <add|+/remove|-> <name/steamID> to add or remove someone
    /friend list to list your friends

    Usage for plugin devs

    To call the functions from this API your plugin needs to get the plugin instance.
    Code (C#):
    private Plugin Friends;

    Friends?.Call("HasFriend", playerId, targetId)
    To listen for when a friend is added or removed, use the following hooks:
    Code (C#):
    private void OnFriendAdded(string playerId, string friendId)
    Code (C#):
    private void OnFriendRemoved(string playerId, string friendId)
    Available functions
    Code (C#):
    bool AddFriend(ulong playerId, ulong friendId)
    bool AddFriendS(string playerId, string friendId)
    bool RemoveFriend(ulong playerId, ulong friendId)
    bool RemoveFriendS(string playerId, string friendId)
    bool HasFriend(ulong playerId, ulong friendId)
    bool HasFriendS(string playerId, string friendId)
    bool AreFriends(ulong playerId, ulong friendId)
    bool AreFriendsS(string playerId, string friendId)
    bool IsFriend(ulong playerId, ulong friendId)
    bool IsFriendS(string playerId, string friendId)
    string[] GetFriendList(ulong playerId)
    string[] GetFriendListS(string playerId)
    ulong[] IsFriendOf(ulong playerId)
    string[] IsFriendOfS(string playerId)
    bool HadFriend(ulong playerId, ulong friendId)
    bool HadFriendS(string playerId, string friendId)
    bool WereFriends(ulong playerId, ulong friendId)
    bool WereFriendsS(string playerId, string friendId)
    bool WasFriend(ulong playerId, ulong friendId)
    bool WasFriendS(string playerId, string friendId)
    ulong[] GetFriends(ulong playerId)
    string[] GetFriends(string playerId)
    shturval, varcolac, Creepstar and 3 others like this.