Listening to Every Player Online (At a Certain Time)

Discussion in 'Plugin Development' started by Dexeron, Mar 29, 2012.

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

    Dexeron

    So Here is what I would like to do:
    (NOTE: This is a shortened version just so I can test this)

    At 6:30 at night In-Game, I would like the Plugin to check if the player's config file has the boolean "Player.transform" and If it does, send them a message saying; "You have been transformed", just for Example's Sake. How do I listen to the Time, then Check every players config file if the are transformed, and then do something?

    You understand? I would make a Method like "checkPlayer" - How can I put every player online through this method at 6:30 in Game?

    The Method checkPlayer would be like this:
    Code:
        public void checkPlayer(String playerName) {
            dataFile = new File(this.playerData, playerName + ".yml");
            boolean isWerewolf = configPlayer.getBoolean("Player.isWerewolf");
            if (isWerewolf) {
                this.transformPlayer(playerName);           
            }
        }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. I would do a sync repeating task that checks if the time ingame and if it's the time that you want, does the transformation for the players currently online.
     
  3. Offline

    Dexeron

    kumpelblase2 Can Anyone possibly give an example? That is what I really would have liked.

    At least how do I do this sync repeating task?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  4. Offline

    Father Of Time

Thread Status:
Not open for further replies.

Share This Page