Help on Hiding ALL Players !!!

Discussion in 'Plugin Development' started by yustinv2, Apr 10, 2016.

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

    yustinv2

    Im having some problems with my plugin, is about hiding all players from one, i now about get all online players with a FOR loop, but i doesnt work if i disable players and then a player joins, because all players were going to hide but the one who joined doesnt going to, Any help about it? it like the lobby servers with the item what hides every single player !

    Sorry for my bad english...
     
  2. Online

    timtower Moderator Moderator

    @yustinv2 Could listen to the join event.
     
  3. Offline

    MasterDoctor

    To clarify what timtower said, you can listen for the join event and detect if the players are hidden (public boolean) and then if the boolean is true, you hide the player who just joined - else you do nothing. Simple :)
     
  4. Offline

    yustinv2

    I now that, but how i can get the player in a PLAYER variable lets say i do that but to hide the player from the one who joined i need to have it into a variable and then hide him, thats the problem how i can get a PLAYER variable who contains all players who have a MAGMA CREAM (if they have this item is because they hide all players)

    any idea about getting all players who contains a MAGMA CREAM ?
     
  5. Offline

    Lightspeed

    . . . ? whaaaaaat?

    Can you explain in a bit more detail?
     
  6. Offline

    mine-care

    @Lightspeed I think the OP looks for a way to get a collection/array of players who have a MAGMA_CREAM in their inventory to hide them.

    So, to do that, create a List and loop through all online players, and check if they have a Magma cream in their inventory. If they do, add them to the list. Otherwise continue looping.
     
Thread Status:
Not open for further replies.

Share This Page