Skip to content

Commit

Permalink
Merge pull request #98 from xZeroMCPE/Beta
Browse files Browse the repository at this point in the history
Tuned some stuff!
  • Loading branch information
xZeroMCPE authored Aug 12, 2016
2 parents 08d1785 + 5bbde2a commit fe4787f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ This is not just another SurvivalGame plugin. This plugin aims to bring a fully
- Easy arena setup
- Per Arena Permissions
- Lightning and thunder on player deaths (Simulate cannons)
- Multiworld Support
- MultiWorld Support
- MultiLanguage Suppoer
- Events API - Economy, Kits + More!
Plus many, many more features included in this plugin!

Language
--------

SurvivalGames gives server owners a chance to use any language as possible. If you are wanting to help us you may create any languages file that does not exist and create a "Pull Request" and we"ll sure merge it. We are trying to make SurvivalGames support as much language as posibble. The more the "better".
46 changes: 26 additions & 20 deletions src/Andre/SurvivalGames/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class Main extends PluginBase implements Listener
{
public $data;

public $version = "1.0.10"
private static $object = null;
public static function getInstance(){
Expand Down Expand Up @@ -170,13 +170,20 @@ public function onEnable() {
$this->SetStatus=array();
$this->all=0;
$this->config->save();
$this->getServer()->getLogger()->info(TextFormat::YELLOW."------------------------------");
$this->getServer()->getLogger()->info(TextFormat::RED."SurvivalGames has been §eenabled");
$this->getServer()->getLogger()->info(TextFormat::RED."Config: §eLoaded !");
$this->getServer()->getLogger()->info(TextFormat::RED."Developer: §exZeroMCPE §e@xZeroMCPE");
$this->getServer()->getLogger()->info(TextFormat::YELLOW."------------------------------");


$version = $this->version;
$this->getServer()->getLogger()->info("§b
*
*
* _____ _ _ _____
/ ____| (_) | |/ ____|
| (___ _ _ _ ____ _____ ____ _| | | __ __ _ _ __ ___ ___ ___
\___ \| | | | '__\ \ / / \ \ / / _` | | | |_ |/ _` | '_ ` _ \ / _ \/ __|
____) | |_| | | \ V /| |\ V / (_| | | |__| | (_| | | | | | | __/\__ \
|_____/ \__,_|_| \_/ |_| \_/ \__,_|_|\_____|\__,_|_| |_| |_|\___||___/
*
* §cGitHub:§e GitHub.com/xZeroMCPE/SurvivalGames
* §cUsing version: $version
");
}


Expand Down Expand Up @@ -261,15 +268,15 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
$sender->sendMessage("$No_Permission");
return true; }
}else{
$sender->sendMessage(TextFormat::RED . "§d§oPlease use the command in game!!");
$sender->sendMessage(TextFormat::RED . "That command can only be used in-game!");
return true;
}
break;
case "set":
if($sender instanceof Player){
if($this->config->exists("lastpos"))
{
$sender->sendMessage("§cAn arena has already been setup, remove the existing one first");
$sender->sendMessage("TextFormat::BLUE . "Seems like you have already setup an arena");
}
else
{
Expand Down Expand Up @@ -314,7 +321,7 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
$sender->sendMessage(TextFormat::GREEN . "Game settings successfully removed.");
break;
case "start":
Server::getInstance()->broadcastMessage(TextFormat::BLUE. "$Force_Start");
$this->getServer()->broadcastMessage(TextFormat::BLUE. "$Force_Start");
$this->gameStatus=1;
$this->lastTime=5;
break;
Expand Down Expand Up @@ -385,15 +392,15 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
{
$this->config->set("prefix","Game");
}
$this->gameTime=(int)$this->config->get("gameTime");//how long a match is
$this->gameTime=(int)$this->config->get("gameTime");
$this->prefix=(int)$this->config->get("prefix");
$this->gameStatus=0;//status of the game (sign)
$this->lastTime=0;//just a variable :P
$this->players=array();//players
$this->gameStatus=0;
$this->lastTime=0;
$this->players=array();
$this->SetStatus=array();
$this->all=0;//
$this->config->save();
$sender->sendMessage(TextFormat::GREEN. "SurvivalGamess config has been reloaded");
$sender->sendMessage(TextFormat::GREEN. "All SurvivalGames configuration has been reloaded");
break;
default:
return false;
Expand Down Expand Up @@ -1120,7 +1127,7 @@ public function playerBlockTouch(PlayerInteractEvent $event){
}else{
if(!$event->getPlayer()->hasPermission("sg.touch.startgame"))
{
$event->getPlayer()->sendMessage("You don't have permission to join this game.");
$event->getPlayer()->sendMessage("You don't have permission to do that!\nContact the server administration");
}else{

if($this->gameStatus==0 || $this->gameStatus==1)
Expand Down Expand Up @@ -1151,7 +1158,7 @@ public function playerBlockTouch(PlayerInteractEvent $event){
}
else
{
$event->getPlayer()->sendMessage(TextFormat::RED. "[{$this->getConfig()->get("prefix")}] Please leave server, to quit match!");
$event->getPlayer()->sendMessage(TextFormat::RED. "[{$this->getConfig()->get("prefix")}] You are already in an arena");
}
}
else
Expand Down Expand Up @@ -1188,10 +1195,9 @@ public function PlayerQuit(PlayerQuitEvent $event){
}

public function onDisable(){
$this->getServer()->getLogger()->info(TextFormat::GREEN."[SG] Saving All Data...");
$this->saveResource("config.yml");
$this->saveResource("points.yml");;
$this->getServer()->getLogger()->info(TextFormat::GREEN."[SG] All files was saved");
$this->getServer()->getLogger()->info(TextFormat::GREEN."All configuration has been saved!");
}
}
?>

0 comments on commit fe4787f

Please sign in to comment.