Skip to content

ElectroGamesDev/BankUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Information

  • This plugin allows players to store their money in a bank.

Features

  • Withdraw Money into Bank
  • Deposit Money from Bank
  • Transfer Money to Other Players Bank Accounts
  • Transaction Log
  • Daily Interest
  • Configurable Interest Rates
  • Admins Can Manage Other Players Bank With "/bank {PlayerName}"
  • Customizable Messages
  • Automatic Backup System
  • Database Migration
  • MySQL and SQLite Support
  • Developer API
  • Bedrock Economy Support
  • ScoreHud Support

Command

Player Commands

  • /bank

Admin Commands

  • /bank {PlayerName}
  • /bank migrate - DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
  • /bank backup {save | load | restore} - Becareful when loading a backup, you will lose all data since the last saved backup unless you restore it but DO NOT take the risk!

Important

  • This plugin requires the latest version of Bedrock Economy!

ScoreHud Support

  • ScoreHud Tag: {bankui.money}

Images

Bank5 Bank2 Bank3 Bank4 Bank6 Admin

Permissions

  • bankui.cmd
  • bankui.admin
  • bankui.admin.backup (Required to use /bank backup)
  • bankui.admin.migrate (Required to use /bank migrate)

Developer API

  • You can give/take/set/get/save players money/transactions using our API.

BankUI::getInstance()->handleAction($player, $action, $subaction, $amount);

  • Add Money: BankUI::getInstance()->addMoney($playerName, $amount);
  • Take Money: BankUI::getInstance()->takeMoney($playerName, $amount);
  • Set Money: BankUI::getInstance()->setMoney($playerName, $amount);
  • Get Money: BankUI::getInstance()->>getMoney($playerName)->onCompletion(function(float $amount): void{ // Use $amount to get player's balance }, static fn() => null);
  • Add Economy Money: $this->addEconomyMoney($player->getName(),$data[1])->onCompletion(function (bool $updated): void{ if ($updated) { // Addition was successful } else { // Addition was not successful } }, static fn() => null);
  • Take Economy Money: $this->takeEconomyMoney($player->getName(),$data[1])->onCompletion(function (bool $updated): void{ if ($updated) { // Deduction was successful } else { // Deduction was not successful } }, static fn() => null);
  • Get Economy Money: $this->getEconomyMoney($player->getName())->onCompletion(function (float $money): void{ use $money to get the player's money }, static fn() => null);
  • Add Transaction: BankUI::getInstance()->addTransaction($playerName, $transaction);
  • Get Transactions: BankUI::getInstance()->>getTransactions($playerName)->onCompletion(function(string $transactions): void{ // Code (use $transactions) }, static fn() => null);
  • Check If Account Exists: BankUI::getInstance()->>accountExists($playerName)->onCompletion(function(bool $exists): void{ // Use $exists to check if account exists }, static fn() => null);
  • Set Transactions: BackupSystem::getInstance()->setTransaction($playerName, $transactions);
  • Save Data: BackupSystem::getInstance()->saveData($player);
  • Save All Online Players Data: BackupSystem::getInstance()->saveAllData();
  • Backup Data - REQUIRES BACKUP ENABLED: BackupSystem::getInstance()->backupData();
  • Load Backup - REQUIRES BACKUP ENABLED: BackupSystem::getInstance()->loadBackup();
  • Restore Backup - REQUIRES BACKUP ENABLED: BackupSystem::getInstance()->restoreBackup();
  • Migrate Database (Only "SQLite", "MySQL", and "SQL" is supported. "SQL" will migrate the database from/to the current database type in use and you should Save All before using this. Make sure you know what your doing as you can lose all of your data if not used correctly.): DatabaseMigration::getInstance()->migrateDatabase($migrateFrom, $migrateTo);

Config

# If true, players will get daily interest for the money in their bank
enable-interest: true

# Interst Rates is in percentage so if interst-rates = 50, it means 50% Interest Rates, if it is set at 1, it means 1% interest rates. (It is recommended to keep this low)
interest-rates: 1

# Backup System - You may want to set this to false if you think you or your staff may accidentally restore a backup and lose your data
enable-backups: true 

# "enabled-backups" must be true for automatic backups. 
enable-automatic-backups: true

# "enable-automatic-backups" must be true for this. This is how often your databases get automatically backed up. This is in minutes so 60 = 60 minutes. This number should be between 720-1440 (12-24 hours) DO NOT go less
# than 60 (1 hour) as this could cause lag for a few seconds if you have had alot of unique players join yuour server.
automatic-backups-time: 720

database:
  # The database type. "sqlite" and "mysql" are supported.
  type: sqlite

  # Edit these settings only if you choose "sqlite".
  sqlite:
    # The file name of the database in the plugin data folder.
    # You can also put an absolute path here.
    file: players.sqlite
  # Edit these settings only if you choose "mysql".
  mysql:
    host: 127.0.0.1
    # Avoid using the "root" user for security reasons.
    username: root
    password: ""
    schema: your_schema
  # The maximum number of simultaneous SQL queries
  # Recommended: 1 for sqlite, 2 for MySQL. You may want to further increase this value if your MySQL connection is very slow.
  worker-limit: 1
  
# "enable-backups" must be enabled for backups to work.
backup-database:
  # The database type. "sqlite" and "mysql" are supported. This should be set to "mysql" for backups to be most useful although you can use "sqlite" if you do not have a MySQL database.
  type: sqlite

  # Edit these settings only if you choose "sqlite".
  sqlite:
    # The file name of the database in the plugin data folder.
    # You can also put an absolute path here.
    file: backup.sqlite
  # Edit these settings only if you choose "mysql".
  mysql:
    host: 127.0.0.1
    # Avoid using the "root" user for security reasons.
    username: root
    password: ""
    schema: your_schema
  # The maximum number of simultaneous SQL queries
  # Recommended: 1 for sqlite, 2 for MySQL. You may want to further increase this value if your MySQL connection is very slow.
  worker-limit: 1
  
# DO NOT TOUCH
config-ver: 2

Credits

About

A BankUI Plugin For PocketMine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages