blob: 4ca0262932a18ae5e22966ffa117a25cf11653b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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){}
?>
|