Solved Custom Msgs replace %player% with player name.

Discussion in 'Plugin Development' started by Firefox365, Oct 8, 2012.

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

    Firefox365

    In my plugin I have the ability to Put your own Custom messages in the config so when a command is executed you get that message. I would be able to put the player name in the config as %player%
    so if the custom msg is: You have been blown up by %player%! it will replace %player% with sender.getname()?

    Thanks!
     
  2. Offline

    thefiscster510

    PHP:
    String message getConfig().getString("message");
    String message message.replace("%player%"sender.getName()); 
     
    Firefox365 and TwistedMexi like this.
  3. Offline

    Firefox365

    Thanks! almost embarrassed it was that easy... lol
     
  4. Offline

    thefiscster510

    No problem haha
     
Thread Status:
Not open for further replies.

Share This Page