By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.

OK, Don't show this again

This plugin add new currences and api economy
version 1.6
Approved
Direct Download How to install?
1 Downloads / 1 Total
Plugin Description §

CurrencyAPI | PocketMine-MP

Two-way economic A.P.I. to create currencies on the one hand, and on the other the usual economic plugin PocketMine-MP 5

For create currency

Main:

use gft\cur\API;

	/* ... */
		API::getCurrencyManager()->registerCurrency($main->getName(), new YourCurrency());
	/* ... */

Instead of YourCurrency the class of your currency Your Currency:

<?php
namespace your\plugin\space;

use gft\cur\currency\Currency;

class YourCurrency implements Currency {
	public function getPrice(): float {
		return 1;
	}
	public function getExchangeable(): string {
		return "Dollar";
	}
	public function onBuy(float $count): void { /* code */ }
	public function onSell(float $count): void { /* code */ }
	public function setPrice(float $price): void { /* code */ }
	public function getName(): string {
		return "Currency"; // currency name
	}
	public function getSing(): string {
		return "C"; // sing
	}
	public function isBuyable(): bool { return true; }
	public function isSalable(): bool { return true; }

	public function maxCount(): float { return PHP_float_MAX; }

	public function buyLimit(): float { return PHP_float_NAX; }
	public function sellLimit(): float { return PHP_float_MAX; }
}

For use economic side:

Add to balance:

$player->add($currencyName, $count);

For remove from balance:

$player->remove($currencyName, $count);

For set balance:

$player->set($currencyName, $count);

For complete transaction:

$player->transaction($currencyName, $count, $player);

For get balance

$count = $player->get($currencyName);

Commands

/[currency]

  • sell <count: float> all players
  • buy <count: float> all players
  • set <count: float> [player: string] operators only
  • add <count: float> [player: string] operators only
  • remove <count: float> [player: string] operators only
  • transaction <count: float> <player: string> all players
Supported API versions
5.36.0
->
5.36.0
Producers §
  • Collaborators:
    • @Savin1play140
  • Contributors:
    • @DaisukeDaisuke
License §
Categories:
API plugins
Mechanics
Economy
Fun
Permissions
Manage entities
Database
Other files
Permissions
Commands

You can leave one review per plugin release, and delete or update your review at any time

/ 5
Loading...