Hello! I want to modify the plugin Repair and make it so that you have to pay to Repair your tools. I am not 100% sure how to do it, that's why I've made this thread. On other threads i've seen that I have to do something like that: Code: public $economy; $this->economy = $this->getServer()->getPluginMananager()->getPlugin("EconomyAPI"); One of my questions is where do I put the "public $economy;" do I put it right after the main class like that? Code: class Main extends PluginBase { public $economy; ... } To reduce money I want to make a function in the main.php file. How do I reduce money from a player? I just use the reduceMoney($player, $amount) function? Or do I have to check if the player has enough money and then do that ^^? Please don't just throw at me lines of code, because I am new at plugins coding.. Thanks in advance =)
why? he can use: PHP: $this->getServer()->dispatchcommand($player, "takemoney 1000"); but iknow its no good way to do that, but its working too but if player haven't 1000 money, this gives error and its not best way (i mean anyway this run it player haven't enough money)
This gives no feedback whatsoever. Your thought process is on point. Why don't you just try and see? Class properties can be defined anywhere right in the scope of class. This is more a question of language rather than pocketmine.