public void CmdPartyPromote(int index)
    {
        string[] members = party.members;

        for (int k = 1; k < members.Length; k++)
        {
            PartySystem.KickFromParty(party.partyId, name, members[k]);
        }

        PartySystem.LeaveParty(party.partyId, name);
        PartySystem.FormParty(members[index], name);

        Player invitor = onlinePlayers[members[index]];

        for (int a = 1; a < members.Length; a++)
        {
            if (a != index)
            {
                PartySystem.AddToParty(invitor.party.partyId, members[a]);
            }
        }
    }
Example #2
0
    public void CmdAcceptInvite()
    {
        // valid invitation?
        // note: no distance check because sender might be far away already
        if (!InParty() && inviteFrom != "" &&
            Player.onlinePlayers.TryGetValue(inviteFrom, out Player sender))
        {
            // is in party? then try to add
            if (sender.party.InParty())
            {
                PartySystem.AddToParty(sender.party.party.partyId, name);
            }
            // otherwise try to form a new one
            else
            {
                PartySystem.FormParty(sender.name, name);
            }
        }

        // reset party invite in any case
        inviteFrom = "";
    }