aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.inc
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-04-25 10:43:56 +0200
committeralexichi <alexbankai96@gmail.com>2016-04-25 10:43:56 +0200
commit1ffba62faae83e18597270b68580a90ac3032a31 (patch)
tree603d33ed48a9dd3690aeef379eeb7fd8ce3a257f /inc/account.inc
parent3ece645cc83e36aaa36c0258afa0f1b36eb13ca2 (diff)
parentdc28807625b9f53e621ec0d7063d99c2527cfa02 (diff)
downloadcandybox-1ffba62faae83e18597270b68580a90ac3032a31.tar.gz
candybox-1ffba62faae83e18597270b68580a90ac3032a31.tar.bz2
candybox-1ffba62faae83e18597270b68580a90ac3032a31.tar.xz
candybox-1ffba62faae83e18597270b68580a90ac3032a31.zip
Merge remote-tracking branch 'origin/piernov' into alexichi
Conflicts: craftmine.php index.xhtml
Diffstat (limited to 'inc/account.inc')
-rw-r--r--inc/account.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/inc/account.inc b/inc/account.inc
new file mode 100644
index 0000000..19f311d
--- /dev/null
+++ b/inc/account.inc
@@ -0,0 +1,18 @@
+<?php
+require_once("messages.inc");
+
+function debitAccount($amount) {
+ if($_SESSION["mine"]["gold"] <= $amount) {
+ sendError("gold_insufficient");
+ return false;
+ }
+ $_SESSION["mine"]["gold"] -= $amount;
+ return true;
+}
+
+function creditAccount($amount) {
+ $_SESSION["mine"]["gold"] += $amount;
+}
+
+
+?>