From d46a4d75594cebef5fc0c25104bde6242be0571e Mon Sep 17 00:00:00 2001 From: alexichi Date: Sat, 23 Apr 2016 20:39:13 +0200 Subject: add file for server side --- inc/guild.inc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 inc/guild.inc diff --git a/inc/guild.inc b/inc/guild.inc new file mode 100644 index 0000000..5ede1f6 --- /dev/null +++ b/inc/guild.inc @@ -0,0 +1,29 @@ += 150){ + $_SESSION["guild"]= array("miners" => 1); + $_SESSION["mine"]["gold"] -= 150; + echo "Guild has been successfully created"; + } + else{ + echo "Not enough money"; + } +} + +function hireMiner(){ + if(!isset($_SESSION["guild"])){ + echo "

you need to create a guild first"; + } + if($_SESSION["mine"]["gold"] >= 40){ + $_SESSION["guild"]["miners"]++; + $_SESSION["mine"]["gold"] -= 40; + $_SESSION["mine"]["miners"] = $_SESSION["guild"]["miners"]; + $mine = $_SESSION["mine"]; + $guild = $_SESSION["guild"]; + echo $mine["gold"]; + echo $mine["miners"]; + } +} + +?> -- cgit v1.2.3-70-g09d2