Skip to content

Latest commit

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SecureCoinAPI

概要 

宇宙サーバーで使用予定です。

いつどのプラグインでどのタイミングでお金がいじられたかを履歴に残す経済プラグインです。

バグの悪用等でお金が増えていないかを確認できたり、どのプラグインが一番使われているかを分析することができます。

コマンド

プレイヤーのお金を増やす(op)
/addcoin [playerName] [amount]
プレイヤーのお金を減らす(op)
/takecoin [playerName] [amount]
自分のお金を確認
/mycoin
他人のお金を確認
/seecoin [playerName]
お金をセットする(op)
/setcoin [playerName]
お金を渡す
/givecoin [playerName] [amount]
履歴を確認する(op)
/coinhistory [playerName] [page = 1]

API

インスタンスを取得

usespace\yurisi\SecureCoinAPI\SecureCoinAPI;
$api = SecureCoinAPI::getInstance();

お金を追加

$this->main->addCoin(newHistory(
$receive_player,
null,
$amount,
$this->main->getName(),
$this->getDescription()
));

usespace\yurisi\SecureCoinAPI\SecureCoinAPI;
usespace\yurisi\SecureCoinAPI\History$history = newHistory(
$player->getName(),
null,
増やすお金,
"プラグイン名",
"詳細(省略可)"
);
$api->addCoin($history);

お金を減らす

$this->main->takeCoin(newHistory(
$receive_player,
null,
$amount,
$this->main->getName(),
$this->getDescription()
));

usespace\yurisi\SecureCoinAPI\SecureCoinAPI;
usespace\yurisi\SecureCoinAPI\History$history = newHistory(
$player->getName(),
null,
減らすお金,
"プラグイン名",
"詳細(省略可)"
);
$api->takeCoin($history);

お金を取得

$amount = $this->main->getCoin($receive_player);

$api->getCoin($player->getName());

お金をセット

$this->main->setCoin(newHistory(
$receive_player,
null,
$amount,
$this->main->getName(),
$this->getDescription()
));

$api->setCoin(newHistory(
$player->getName(),
null,
セットするお金,
"プラグイン名",
"詳細(省略可)"
));

お金を渡す

$this->main->addCoin(newHistory(
$receive_player,
$sent_player,
$amount,
$this->main->getName(),
$this->getDescription()
));
$this->main->takeCoin(newHistory(
$sent_player,
$receive_player,
$amount,
$this->main->getName(),
$this->getDescription()
));

$api->addCoin(newHistory(
受け取るプレイヤー名,
渡したプレイヤー名,
セットするお金,
"プラグイン名",
"詳細(省略可)"
));
$api->takeCoin(newHistory(
渡したプレイヤー名,
受け取るプレイヤー名,
セットするお金,
"プラグイン名",
"詳細(省略可)"
));

お金が足りるか確認

$api->isEnoughCoin(プレイヤー名, お金);

About

経済プラグイン

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages