Advanced Economy Plugin + API for PocketMine-MP
PocketMine-MP plugins
PocketMine-MP Alpha_1.4 API 1.9.0
MassiveEconomy is an advanced economy plugin.
EvolSoft Website: http://www.evolsoft.tk
This Plugin uses the New API. You can't install it on old versions of PocketMine.
Manage your Server Economy with MassiveEconomy.
With MassiveEconomy you can customize minimum money, money symbol, first join money... (read documentation)
MassiveEconomy includes also an advanced API which you can create your plugins.
What is included?
In the ZIP file you will find:
- MassiveEconomy_v1.0 R3.phar : MassiveEconomy Plugin + API
- MassiveEconomyExample_v1.phar : MassiveEconomy API implementation example
- MassiveEconomyExample : Example Plugin source code
Commands:
**To-Do:**
*- Bug fix (if bugs will be found)* *- MySQL support*
Configuration (config.yml):
---
#Money Symbol
money-symbol: "$"
#Default money when a player joins for first time (he must have the permission: massiveeconomy.receivedefault)
default-money: 500
#Minimum money that the player can have (you can use also negative numbers)
min-money: 0
...
Commands:
/massiveeconomy - MassiveEconomy commands (aliases: [meco, massiveeco, me])
/money <player (optional)> - Show your money (or player's money)
/pay <player> <amount> - Pay a player
/setmoney <player> <amount> - Set player money
Permissions:
-
- massiveeconomy.* - MassiveEconomy permissions.
-
- massiveeconomy.receivedefault - Receive default money permission.
-
- massiveeconomy.commands.help - MassiveEconomy command Help permission.
-
- massiveeconomy.commands.info - MassiveEconomy command Info permission.
-
- massiveeconomy.commands.reload - MassiveEconomy command Reload permission.
-
- massiveeconomy.commands.setmoney - MassiveEconomy command SetMoney permission.
-
- massiveeconomy.commands.pay - MassiveEconomy command Pay permission.
-
- massiveeconomy.commands.money - MassiveEconomy command Money permission.
-
- massiveeconomy.commands.money.others - Show other players' money permission.
Basic Tutorial:
1. Define the plugin dependency in plugin.yml:
depend: [MassiveEconomy]
2. Include MassiveEconomy API in your php code:
use MassiveEconomy\MassiveEconomyAPI;
3. Check if MassiveEconomy API is compatible (insert this code in onEnable() function)
if(MassiveEconomyAPI::getInstance()->getAPIVersion() == "(used API version)"){
//API compatible
}else{
//API not compatible
$this->getPluginLoader()->disablePlugin($this);
}
4. Call the API function:
MassiveEconomyAPI::getInstance()->(API function);
A full plugin example using MassiveEconomy API is included in the ZIP file.
API Functions:
string getMoneySymbol()
Description:
Get money symbol (defined in config).
Return:
money symbol
int getDefaultMoney()
Description:
Get default money (defined in config).
Return:
default money
int getMinimumMoney()
Description:
Get minimum money (defined in config).
Return:
minimum money
string getVersion()
Description:
Get the MassiveEconomy plugin version.
Return:
plugin version
string getAPIVersion()
Description:
Get the MassiveEconomy API version.
Return:
plugin API version
void RegisterPlayer(Player $player)
Description:
Register a player to MassiveEconomy.
Parameters:
$player must be the Player (pocketmine/Player)
boolean isPlayerRegistered($player)
Description:
Check if a player is registered to MassiveEconomy.
Parameters:
$player must be the player name
Return:
true if the player is registered
false if the player isn't registered
int|boolean getMoney($player)
Description:
Get player money.
Parameters:
$player must be the player name
Return:
player money if the player is registered
false if the player isn't registered
boolean setMoney($player, $amount)
Description:
Set player money.
Parameters:
$player must be the player name
$amount the amount (must be a number)
Return:
player money if the player is registered
false if the player isn't registered
boolean payPlayer($receiver, $amount)
Description:
Pay a player.
Parameters:
$receiver must be the player name
$amount the amount (must be a number)
Return:
true if the player is registered
false if the player isn't registered
int payMoneyToPlayer($sender, $amount, $receiver)
Description:
Pay money to player from another player.
Parameters:
$sender must be the player name
$amount the amount (must be a number)
$receiver must be the player name
Return:
3 success
2 if the sender hasn't enough money
1 if the receiver isn't registered
0 if the sender isn't registered
int takeMoney($player, $amount)
Description:
Take Money from Player.
Parameters:
$player must be the player name
$amount the amount (must be a number)
Return:
2 success
1 if the player hasn't enough money
0 if the player isn't registered