<?php __HALT_COMPILER(); ?>
                     src/pawarenessc/AllS/Main.php5  \5  aO>      %   src/pawarenessc/AllS/CallbackTask.phpf  \f  +B4V      
   plugin.yml   \   ӬǶ      <?php

namespace pawarenessc\AllS;

use pocketmine\plugin\PluginBase;

use pocketmine\event\Listener;

use pocketmine\Player;

use pocketmine\Server;

use pocketmine\level\Level;

use pocketmine\math\Vector3;

use pocketmine\command\Command;






use pocketmine\command\CommandSender;

use pocketmine\utils\Config;




class Main extends pluginBase implements Listener{

public function onEnable() {



 $this->getLogger()->info("=========================");

 $this->getLogger()->info("AllSを読み込みました");

 $this->getLogger()->info("v0.1");

 $this->getLogger()->info("=========================");

 $this->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this, "survival"]), 10);
 
 $this->config = new Config($this->getDataFolder() . "names.yml", Config::YAML);
 
 $this->getServer()->getPluginManager()->registerEvents($this, $this);
 }
 
 public function onCommand(CommandSender $sender, Command $command, string $label, array $args) :bool{

 switch ($command->getName()){
  case "adds";
  if (empty($args[0])){



                $sender->sendMessage("§b使い方 : /adds <プレイヤーネーム>");



                return true;



            }
  $name = $args[0];
  $sender->sendMessage("{$name} を追加しました。");
  $this->config->set($name);
  $this->config->save();
  
  return true;
 }
}
 
 
 public function survival(){
 foreach(Server::getInstance()->getOnlinePlayers() as $player){
   $name = $player->getName();
   if($player->isOp() or $this->config->exists($name)){
   }else{
   $player->setGamemode(0);
   return true;
   }
  }
 }
}
<?php



/*

 *

 *  ____            _        _   __  __ _                  __  __ ____

 * |  _ \ ___   ___| | _____| |_|  \/  (_)_ __   ___      |  \/  |  _ \

 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |

 * |  __/ (_) | (__|   <  __/ |_| |  | | | | | |  __/_____| |  | |  __/

 * |_|   \___/ \___|_|\_\___|\__|_|  |_|_|_| |_|\___|     |_|  |_|_|

 *

 * This program is free software: you can redistribute it and/or modify

 * it under the terms of the GNU Lesser General Public License as published by

 * the Free Software Foundation, either version 3 of the License, or

 * (at your option) any later version.

 *

 * @author PocketMine Team

 * @link http://www.pocketmine.net/

 *

 *

*/



namespace pawarenessc\AllS;



use pocketmine\scheduler\Task;



/**

 * Allows the creation of simple callbacks with extra data

 * The last parameter in the callback will be this object

 *

 * If you want to do a task in a Plugin, consider extending PluginTask to your needs

 *

 * @deprecated

 * Do NOT use this anymore, it was deprecated a long time ago at PocketMine

 * and will be removed at some stage in the future.

 */



class CallbackTask extends Task {



	/** @var callable */

	protected $callable;



	/** @var array */

	protected $args;



	/**

	 * @param callable $callable

	 * @param array    $args

	 */

	public function __construct(callable $callable, array $args = []){

		$this->callable = $callable;

		$this->args = $args;

		$this->args[] = $this;

	}


	/**

	 * @return callable

	 */

	public function getCallable(){

		return $this->callable;

	}



	/**

	 * @param $currentTicks

	 */

	public function onRun($currentTicks){

		call_user_func_array($this->callable, $this->args);

	}



}
name: AllS
version: 0.1
api: [3.0.0,3.8.0,4.0.0]
main: pawarenessc\AllS\Main
author: PawarenessC
description: ずっとサバイバル
commands:

 adds:

  description: "ADD Survival"

  usage: " /adds "4<zVj9o   GBMB