Created
September 13, 2013 10:12
-
-
Save Omattyao/6548872 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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