diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/guild.inc | 30 | ||||
-rw-r--r-- | inc/mine.inc | 2 | ||||
-rw-r--r-- | inc/mine.inc~ | 20 |
3 files changed, 31 insertions, 21 deletions
diff --git a/inc/guild.inc b/inc/guild.inc new file mode 100644 index 0000000..4ca0262 --- /dev/null +++ b/inc/guild.inc @@ -0,0 +1,30 @@ +<?php + +function createGuild(){ + if($_SESSION["mine"]["gold"] >= 50 && !isset($_SESSION["guild"])){ + $_SESSION["guild"]= array("miners" => 1); + $_SESSION["mine"]["gold"] -= 50; + echo "Guild has been successfully created"; + } + else{ + echo "g"; + } +} + +function hireMiner(){ + if(!isset($_SESSION["guild"])){ + echo "you need to create a guild first"; + } + if($_SESSION["mine"]["gold"] >= 20 && isset($_SESSION["guild"])){ + $_SESSION["guild"]["miners"]++; + $_SESSION["mine"]["gold"] -= 20; + $_SESSION["mine"]["miners"] = $_SESSION["guild"]["miners"]; + $mine = $_SESSION["mine"]; + echo $mine["gold"] +","+ $mine["miners"]; + } +} + +//function buy($obj,$prix){} + + +?> diff --git a/inc/mine.inc b/inc/mine.inc index 6a04cc4..94a2c66 100644 --- a/inc/mine.inc +++ b/inc/mine.inc @@ -1,7 +1,7 @@ <?php function initCraftMine() { - $_SESSION["mine"] = array("mine" => 0, "gold" => 0, "miners" => 1); + $_SESSION["mine"] = array("mine" => 0, "gold" => 0, "miners" => 0); } function withdrawMine() { diff --git a/inc/mine.inc~ b/inc/mine.inc~ deleted file mode 100644 index a01d768..0000000 --- a/inc/mine.inc~ +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -function initCraftMine() { - $_SESSION["mine"] = array("mine" => 0, "or" => 0, "miners" => 1); -} - -function withdrawMine() { - $mine = $_SESSION["mine"]; - $_SESSION["mine"]["gold"] += $mine["mine"]; - $_SESSION["mine"]["mine"] = 0; -} - -function sendMine() { - if(empty($_SESSION["mine"])) initMine(); - $mine = $_SESSION["mine"]; - echo $mine["gold"]; -} - - -?> |