Skip to content

Instantly share code, notes, and snippets.

@Omattyao
Created September 13, 2013 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Omattyao/6548872 to your computer and use it in GitHub Desktop.
Save Omattyao/6548872 to your computer and use it in GitHub Desktop.
<?php
/*
__PocketMine Plugin__
name=AdonPlugin
description=Udon
version=0.1
author=Adon
class=AdonPlugin
apiversion=6,7,8,9,10
*/
define("KANKAKU", 10 * 60);
define("KINGAKU", 10000000);
class AdonPlugin implements Plugin{
private $api;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
}
public function init(){
$this->api->schedule(KANKAKU, array($this, "giveMoney"), false, true);
}
public function __destruct(){
}
public function giveMoney() {
$data = array(
"issuer" => "AdonPlugin",
"username" => false,
"method" => "grant",
"amount" => KINGAKU,
);
$message = "[AdonPlugin] You've got money!";
$players = $this->api->player->getAll();
foreach ($players as $player) {
$data["username"] = $player->username;
$this->api->dhandle("money.handle", $data);
$player->sendChat($message);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment