Today, I'm bringing a thread to help developers and future developers! I'm creating this thread so you all can get accustomed to plugin developing. Credits: Falk(PurePerms API) Spoiler: API TUTORIALS Spoiler: Economy$ By OneBone This one is very simple! So first, lets assume you have already defined $player, as that is what we will be using! Now first, lets check $player's balance. To do so use the code Spoiler: Show Money PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI")->myMoney($player); Simple and easy, right? Now lets take away money! Use the following code to do so. Spoiler: Remove Money PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI")->reduceMoney($player, 10000); Note, the 10,000 is the money amount so be sure to change that! Now finally, lets add money with this line of code. Spoiler: Add Money PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI")->addMoney($player, 10000); Again the 10,000 can be changed to anything! Spoiler: Variables Variables are some of the most common used "code" pieces in plugins! They help substitute big lines of code. Think of them as abrievations. Take a look at this one for example Spoiler: EXAMPLE PHP: $item1 = Item::get(Item::DIAMOND_SWORD, 0, 1); Normally that would be a pain in the butt to rewrite over and over, so thats where variables come in! Defining a variable is simple, use the template I have created Spoiler: TEMPLATE Code: $variable = code goes here; Spoiler: What Is A Variable A variable is basically a shorter way of using code. Sort of like a definition. Feel free to add suggestions, tips, etc!
You should add a variable for the PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI") so people understand what you can do with variables.
He should explain in theory what variables can do, not just practical. That's like reading code. And for newbies reading code is like reading chinese [if the newbie isn't chinese].
As I said, 'so people understand what you can do with variables'. I did not mean removing the theory, but just add a small example to show what they can do.
I know, I'm in the proccess of writing a huge Variables.PHP file with all that stuff and what it does, I've been adding stuff to it as I go and will be posting it. But tutorials will keep coming to, just give me time.