1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Party

Discussion in 'Facepalm' started by Zayd, May 21, 2017.

Thread Status:
Not open for further replies.
  1. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    So, I have created my duel plugin. It allows you to create 1vs1's on your server, and is much similar to those of Minifixio's.

    I now want to create a party feature within this plugin.
    For people that do not know what a party is...
    Parties are a group of players that have a leader. Whatever match the leader decides to enter, the members are automatically dragged. (Like Mineplex).
    Parties can be controlled using commands such as /party create, /party invite, /party kick etc.
    Depending on the numbers of player in the party, the match will be sorted accordingly. So, for example a party of 5 cannot fight a party of 6, obviously, because it is unfair.
    However, if parties decide to click gamemodes that are not relevant to the amount of players in their party, members will be against their team OR kicked from the party. Badlion has a system like this, in which I am trying to re-create.

    I was wondering how I could go about this, and make my 1vs1/duel plugin compatible.
    You see, my 1vs1 plugin adds the player to the array on queue and then the task checks if the queue count is equal to 2, then starts the duel. It also does this if a player leaves the match, so if the queue count is below 2, it will abort the duel.
    Thanks for any help!
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    if you want your plugins to work with something, it's best to create that something FIRST so you could easier integrate it
     
    corytortoise likes this.
  3. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    Yeah... any way I can go about creating the party plugin?
     
  4. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    yes, i need help with this too! i want to make the actual 'party'
     
  5. Thouv

    Thouv Slime

    Messages:
    84
    GitHub:
    adeynes
    You should first try to make a "rough draft" of some code- it doesn't have to be perfect or work, just make something so we know what you want and then we can help you about the specifics. Because rn you're asking about how to make an entire plugin, and we can't just tell you how to build it if you don't give us smthg to help you with :)
     
  6. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    I have no idea when to start of this, like, what do I do at all?
    I know the commands I can create, but the actual party members in an array, but like... I am confused to how to make the actual 'party'
     
  7. Thouv

    Thouv Slime

    Messages:
    84
    GitHub:
    adeynes
    Have a party array, and when a party is created, add the party members, the leader, the gamemode, etc
    PHP:
    private $parties = [];
    public function 
    createParty($name$leader, array $members$gamemode)
    {
        if(!isset(
    $this->parties[$name]))
        {
            
    $this->parties[$name] = [$leader$members$gamemode];
        } else
        {
            return 
    "party exists"
        
    }
    }
    This is just one way to make this, and I haven't thought much about it, there are infinitely many ways to do this, and probably much better ones than mine
     
    jasonwynn10 likes this.
  8. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    Thankyou man! Is really helpful... but what if a party is like disband? I just remove from array?
     
  9. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Instead of having us baby you, why don't you try it on your own?
     
    Thouv likes this.
  10. Thouv

    Thouv Slime

    Messages:
    84
    GitHub:
    adeynes
    You're gonna need some knowledge of PHP to make plugins. If you don't know how to remove a party based on what I gave you, then you're not gonna be able to make anything in your plugin.
     
    jasonwynn10 likes this.
  11. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    Zayd, stop being an imbecile and using multiple accounts to seem as if others are having the same issue.

    Proof is in the pudding.
     
    Muqsit and Sandertv like this.
  12. Lowkey

    Lowkey Slime

    Messages:
    94
    I don't like to cause drama, but Zayd is my brother. Wherever that was posted, it wasn't him.
     
    Sandertv and jasonwynn10 like this.
  13. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    I'd like to avoid drama as well, but:

    1) He literally DM'd me telling me it was him on his own Twitter account.

    2) Tell me why Zuruki and Zayd just happen to have the same birthday, including the year.

    3) They worked on projects "together" on GitHub.

    4) And it's kind of coincidental that you have such close relation to him when you joined only a month after, but coincidences do happen here and there.
     
    Last edited: Jun 5, 2017
  14. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    still if we now know are they both the same person or not, what benefits does it bring?
     
    jasonwynn10 likes this.
  15. Lowkey

    Lowkey Slime

    Messages:
    94
    Yeah, Irish didn't have to comment anything at all that wasn't beneficial. See what I mean about causing drama?
     
  16. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    I don't have a problem with helping people, but when someone acts as if they're multiple people then it complicates the situation. Asking questions is not bad, you have to learn sometime or another, just don't hide and pretend to be someone else if you want help.


    You are really pushing it, please just avoid responding so no conflicts continue.
     
    Last edited: Jun 5, 2017
  17. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Whether it is beneficial or not, it's enough to know that this is going off-topic.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.