Skip to content

EvolSoft/MassiveEconomy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

start2

MassiveEconomy

Advanced Economy Plugin + API for PocketMine-MP

Download!

Category

PocketMine-MP plugins

Requirements

PocketMine-MP Alpha_1.4 API 1.9.0

Overview

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:

/massiveeconomy - MassiveEconomy commands
/money - Show your money
/pay - Pay a player
/setmoney - Set player money

**To-Do:**

*- Bug fix (if bugs will be found)* *- MySQL support*

Documentation

For Users:

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.

For Developers

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:

Get Money Symbol:
string getMoneySymbol()

Description:
Get money symbol (defined in config).
Return:
money symbol

Get Default Money:
int getDefaultMoney()

Description:
Get default money (defined in config).
Return:
default money

Get Minimum Money:
int getMinimumMoney()

Description:
Get minimum money (defined in config).
Return:
minimum money

Get Version:
string getVersion()

Description:
Get the MassiveEconomy plugin version.
Return:
plugin version

Get API Version:
string getAPIVersion()

Description:
Get the MassiveEconomy API version.
Return:
plugin API version

Register Player:
void RegisterPlayer(Player $player)

Description:
Register a player to MassiveEconomy.
Parameters:
$player must be the Player (pocketmine/Player)

Check if a Player is registered:
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

Get Money:
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

Set Money:
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

Pay Player:
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

Pay Player from Player
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

Take Money:
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