Sender and Receiver Messages

Discussion in 'Plugin Development' started by Reptar_, Jul 28, 2014.

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

    Reptar_

    I'm trying to fulfill a plugin request. I have to make it so when players chat, their message is sent to all players. But depending on the distance between the message sender and the receiver, the message color varies. Currently, I'm canceling the chat event and sending all players a message and changing the message color based on the distance between the sender and receiver. But I feel like there's an easier way. Here's my code:

    http://pastebin.com/3UNinGxX

    Please help. :[
     
  2. Offline

    fireblast709

    Reptar_ you can calculate the distance once, and use an if...else if...else to determine the format which you set once
     
  3. Offline

    Reptar_

    Ok, but what about the messages? Is there an easier way to do what I have now?
     
  4. Offline

    fireblast709

    Reptar_ it looks pretty optimised
     
Thread Status:
Not open for further replies.

Share This Page