Basically I want it to be when a player joins, and someone welcomes them, they get $75. No config, no nothing. But make it so that after 7 seconds, any welcoming won't work on the player and they won't get money. Pretty simple. A timer makes it so they can't welcome too late. Thanks.
When a player joins, to make people want to welcome others, the player gets $75 for welcoming a new player. Just by saying 'Welcome' within 7 seconds of the newcomer joining, they get the money.
17xDillz1997 I can do this - but how is my plugin supposed to know if the player is joining for the first time? EDIT: nevermind, I think I know how. Do you need a message to be displayed as well?
@17xDillz199, WelcomeMoney has been made to your specifications. Download: https://drive.google.com/file/d/0B3nfDLDrJYvdSGhES0NfOWdKdk0/edit?usp=sharing Screenshot: http://i.imgur.com/4X7dTx0.png Source code: http://pastebin.com/raw.php?i=WEFrMEVf Marten Mooi, If you need some help look at my source xD (Also he stated that on welcome not on first welcome so.) EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I wanted it for when a player joins for the first time. This way people cannot just leave and join and say 'welcome' to get money. I realised a few bugs: People can say 'Welcome' multiple times to get cash. If any sentence has 'Welcome' in it with a capital 'W' they get $75. Thanks for your effort so far, you're amazing.
@17xDillz199, I have added the following code: Code:java if(sd.contains(p.getName())) {return;} sd.add(p.getName()); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {public void run() {sd.remove(p.getName());}}, 140L); New download: https://drive.google.com/file/d/0B3nfDLDrJYvdRmFoZ0NaNm9jek0/edit?usp=sharing Changes: - Stopped being able to spam 'Welcome' and receive more money. Now cancels if they have already said it. NOTE: If a sentance contains Welcome it will give them $75 as long as the ArrayList is not empty. This is so that it can support messages such as "Welcome you whale!", or "Welcome xAstraah!" Also it checks for Lowercase too. EDIT: New Source: http://pastebin.com/raw.php?i=pTf18rmK
17xDillz1997, Sorry didn't know you wanted it just for the first join ill add that now. EDIT: Added: Code:java if(p.hasPlayedBefore()) { return; } Now will stop the code running past it and will hence stop the message check. Download: https://drive.google.com/file/d/0B3nfDLDrJYvdb3NKVkY0T1lzWXM/edit?usp=sharing Source: http://pastebin.com/raw.php?i=16j2JseT (I have not tested any code after the first download please let me know if they're any issues)
@17xDillz1997, I have resolved the problem changed how it checks the messages around and has been tested and now works perfectly. If you need anything else i should be available most of today so ask quickly. Download: https://drive.google.com/file/d/0B3nfDLDrJYvddjdIbklYZjAtcU0/edit?usp=sharing Source: http://pastebin.com/raw.php?i=Kt6EPDdF
Works perfectly, I thank you so very much. Do you want me to put this on Bukkit or keep it private? I could credit you if you want.
17xDillz1997, I give permission for this plugin to be posted on BukkitDev but i would like the be a Plugin Manager or Whatever on the post. Also i will update it if so. And credit will be given at the top of the page.