Send players a message in a certain region.

Discussion in 'Plugin Development' started by anonym110, Apr 19, 2012.

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

    anonym110

    Hello, I'm currently developing a arena-event plugin. Everytime a player kills somebody from the enemy team a broadcast shows the current score. This spams the chat pretty and for everybody not participating in the arena the chat becomes unreadable.

    So now I'm looking for a way to only broadcast/send the message to players in a certain region.
    Basically I'd imagine it going like this:
    Option 1: Find players in the defined region/cubiod/chunk and send all of them a message
    Option 2: Sending a message from a block and only players within a radius recieve the message.

    Is it possible like that? What would you do to get the players? Is there maybe a even easier way to do this?
     
  2. Offline

    lzravanger

    Option 1: Hook into regions plugin of choice. Get all players, get all players in region, send players a message.

    Option 2: Get block location. Get player location. Get distance between locations. Check for threshold.
     
  3. Offline

    anonym110

    But getting all players? Won't that use up a lot of ressources?
     
  4. Offline

    Njol

    There barely exist servers that can handle more than 100 players, and even if there was a server capable of handling a million players, simply sending some of them a message would still not be much.
     
Thread Status:
Not open for further replies.

Share This Page