getting a players last message?

Discussion in 'Plugin Development' started by jb42300, Oct 25, 2014.

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

    jb42300

    No how can i get a players last message that they sent, i want to use it in a no spam plugin :p any help would be great
     
  2. Offline

    ebear

    Wait...

    Do you want it to get the last message or review the message before it's displayed?
     
  3. Offline

    jb42300

    ebear i wana get the last message

    ex:

    jb42300: hi
    if i say hi again
    you may not reapet the same message
     
  4. Offline

    ebear



    Alright.

    My best idea would be to log the messages as they are sent into a database file or something.

    You'd check to see if the first message was identical to the message sent, and if it is, set the message to null and send the player the message saying that they're spamming.

    I'm not going to write the code for you, but I'll help you this much. If there's another issue, let me know. I'll try my best to help.
     
  5. Offline

    rbrick

    Use a Map<String, String> the key would be the players name(or uuid if you so choose) and the value would be their last sent message.
     
    ebear likes this.
Thread Status:
Not open for further replies.

Share This Page