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

Set Max Players Game

Comments in 'Plugin Development' started by DevWars, Nov 25, 2015.

  1. DevWars
    Offline

    DevWars Banned

    Joined:
    Nov 7, 2015
    Posts:
    28
    Minecraft User:
    PmServer
    Hello "
    How to set max players in MiniGames
    Example :
    SignChange
    [Join]
    [Max Player Game]
    [Player Join The Game]
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Is "MiniGames" a world?
  3. DevWars
    Offline

    DevWars Banned

    Joined:
    Nov 7, 2015
    Posts:
    28
    Minecraft User:
    PmServer
    No " How to set the maximum players at anything Example: If touched specified Block brings me to the place or give me something specific, but it must be the maximum for players 3, 4 or 5 , and so on , but nothing to do with players callers but have a relationship in the game such as the MiniGames
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Use the EntityLevelChangeEvent and check how many players are in the target world. Cancel the event if the max amount of players are in the world.
  5. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    if(count($this->p)<=5){
    return 
    True;
    }
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    There is plenty ways to do it. You must be creative and make your own!

    For example in team deathmatch.

    Before assigning player to team check:

    BlueTeam->getMaxPlayers() <= count(BlueTeam->getPlayers()) {
    Player->sendMessage('Team is full');
    } else {
    Player->sendMessage('Joined to BlueTeam');
    }

    #UseBrains
    iDirtPlayzMC likes this.

Share This Page

Advertisement