Hi, I have coded an plugin that changes the join and leave messages with an config.yml, but I don't know how to add the player's name to that. Can you help me? -GeistFan
This guy has been here for months making that plugin and asking where to put each character, this is going nowhere. Put your own effort into it! https://forums.pmmp.io/threads/plugin-unexpected.10951/#post-78395 https://forums.pmmp.io/posts/78056/ https://forums.pmmp.io/posts/78043/ https://forums.pmmp.io/threads/my-plugin-doesnt-load-and-it-dont-show-any-error.10802/ https://forums.pmmp.io/threads/solved-my-plugin-joinleave.10301/ His first thread regarding this particular plugin was in August 21st 2020, 9 months ago!
So you just want to judge me because, as someone who is not very good at programming, I want to make a working plugin, right? -GeistFan
You're just looking for someone to hand you the code. What answer is sufficient for your question? Are you expecting a code or an explanation on how to write code? I just don't get it. In 9 months you could have learned some common sense, and by now I can tell you that you have absolutely no intentions to learn. Please, watch this video:
Here's the code, Also you can check out other plugins on GitHub and learn more about it. Here's PMMP documentation: apidoc.pmmp.io Here is the PHP documentation about STR_REPLACE: https://www.php.net/manual/en/function.str-replace.php PHP: public function onJoin(PlayerJoinEvent $event){ $joinMSG = $this->getConfig()->get("JoinMSG"); // Get's the JoinMSG value from the config.yml $playerName = $event->getPlayer()->getName(); // Get's the joined Player name $event->setJoinMessage(str_replace("{name}",$playerName,$joinMSG));}
Hmm...yeah. Maybe try figuring out problems you encounter yourself next time! There are lots of search engines you can use! Just type in your problem and add "pmmp" at the end to get some good results!