NOTE: This is for v1 only.
This is fully 100% made by me only dbs headers aint mine. lol:p
Make a file called crystalshop.php
Add
<?php
//Coded By Alan
//Free Mod/Code
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
print "Welcome to the crystal shop this is were you can spend all you crystals on.";
print "You currently have {$ir['crystals']} crystals
";
if($_GET['type'] == "")
{
Print "Armor
[url='crystalshop.php?type=plashield']Plasma Shield - 25 Crystals[/url]
[url='crystalshop.php?type=rynaxplasheild']Rynax Plasma Shield - 45 Crystals[/url]
";
Print "Guns
[url='crystalshop.php?type=plasmgun']Plasma Gun - 65 Crystals[/url]
[url='crystalshop.php?type=plasmarifle']Plasma Rifle - 85 Crystals[/url]
";
Print "Medical
[url='crystalshop.php?type=willpot']Will Potion - 30 Crystals[/url]
[url='crystalshop.php?type=smallhealth']Small Potion - 10 Crystals[/url]
";
Print "Food
[url='crystalshop.php?type=sacklunch']Sack Lunch - 3 Crystals[/url]
[url='crystalshop.php?type=hamburger']Hamburger - 5 Crystals[/url]
";
}
else if($_GET['type'] == "plashield")
{
if($ir['crystals'] <25)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-25 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',97,$userid,1)",$c);
print "You successfully traded 25 crystals for a Plasma Shield and gone in to your items.";
}
}
else if($_GET['type'] == "rynaxplasheild")
{
if($ir['crystals'] <45)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-45 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',98,$userid,1)",$c);
print "You successfully traded 45 crystals for a Rynax Plasma Shield and gone in to your items.";
}
}
else if($_GET['type'] == "plasmgun")
{
if($ir['crystals'] <65)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-65 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',99,$userid,1)",$c);
print "You successfully traded 65 crystals for a Plasma Gun and gone in to your items.";
}
}
else if($_GET['type'] == "plasmarifle")
{
if($ir['crystals'] <85)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-85 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',100,$userid,1)",$c);
print "You successfully traded 65 crystals for a Plasma Rifle and gone in to your items.";
}
}
else if($_GET['type'] == "willpot")
{
if($ir['crystals'] <30)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-30 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',34,$userid,1)",$c);
print "You successfully traded 30 crystals for a Will Potion and gone in to your items.";
}
}
else if($_GET['type'] == "smallhealth")
{
if($ir['crystals'] <10)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-10 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',3,$userid,1)",$c);
print "You successfully traded 10 crystals for a Small Potion and gone in to your items.";
}
}
else if($_GET['type'] == "sacklunch")
{
if($ir['crystals'] <3)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-3 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',1,$userid,1)",$c);
print "You successfully traded 3 crystals for a Sack Lunch and gone in to your items.";
}
}
//This is type like a function
else if($_GET['type'] == "hamburger")
{
if($ir['crystals'] <5)
{
die("You don't have enough crystals!");
}
else
{
mysql_query("UPDATE users SET crystals=crystals-5 WHERE userid=$userid",$c);
mysql_query("INSERT INTO inventory VALUES('',5,$userid,1)",$c);
print "You successfully traded 5 crystals for a Hamburger and gone in to your items.";
}
}
$h->endpage();
?>
Then Save and your done
A little mod created by me thanks alan