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

Set Max Players?

Discussion in 'Development' started by Harviy, Jan 17, 2017.

  1. Harviy

    Harviy Spider

    Messages:
    13
    I want to set the maximum number of players in the game. I did some research, but I could not find the required code. How can I do that?
     
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    You cannot set maxplayers, $maxplayers in server.php is private. You can only write something that modifies server.properties and reloads the server
     
    applqpak likes this.
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    maybe reflectors will do the trick!
    EDIT: Please dont doe
     
  4. Harviy

    Harviy Spider

    Messages:
    13
    Thanks, the mind has come up with a different method.
     
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You can do it.
    QueryRegenerateEvent.
    PHP:
    public function onPing(QueryRegenerateEvent $event){
        
    $event->setPlayerCount(integer);
    }
     
    applqpak likes this.
  6. kaliiks

    kaliiks Zombie

    Messages:
    250
    It change max players in query but dont change slots of serverIt change max players in query but dont change slots of server
     
  7. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    so use reflector class?
     
    0x15f likes this.
  8. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Modify your auth plugin to check how many players are already online, and block login if it's at your chosen limit?
     
    applqpak likes this.
  9. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    wtf?
    that's hacky
     
  10. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    that's what you do when you dont get what you wanted right?
    if they insist, or just choose not to add that
    just whip out your finale tool and rule it all, (Use it responsibly and as always on your own risk)
     
    applqpak and Muqsit like this.
  11. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You could actually just cancel the kick event.
     
    applqpak likes this.
  12. imYannic

    imYannic Baby Zombie

    Messages:
    113
    Finally!

    Take a look on VIPSlots.
     
  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.