ok first make a item type called
virus
then add 5 items called
Adware Virus
Spyware Virus
Polymorphic Virus
Firewalk Virus
Trojan Virus
under the item type virus
then make a file called virus.php in it put:
<?php
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();
if($ir['jail'])
{echo "You are in jail you cannot do this";}
if($ir['hospital'])
{echo "You are in the hospital you cannot do this";}
if ($ir['level'] <14)
{echo "Your Level Is To Low To Even Buy A Computer"; EXIT;}
if ($ir['computer'] ==0)
{echo "[url='buycomputer.php']Click Here[/url] to buy a computer</a>"; EXIT;}
switch ($_GET['action']) {
case 'mavirus': makeavirus(); break;
case 'msvirus': makesvirus(); break;
case 'mpvirus': makepvirus(); break;
case 'mfvirus': makefvirus(); break;
case 'mtvirus': maketvirus(); break;
default: index(); break; }
function index()
{
$acvirus = "100";
$scdvirus="150";
$pcvirus="200";
$fcvirus="250";
$tcvirus="300";
echo "You turn on your computer and look at the type viruses you can make.
What kind virus would you like to make?
<font size='1'>Be careful</font>
<table border='0'><tr bgcolor='steelblue'><th>Virus Name</th><th>Cost To Make</th><th>Do</th></tr><tr bgcolor='lightsteelblue'><td>Adware Virus</td><td>\$$acvirus</td><td>[url='virus.php?action=mavirus']Do[/url]</td></tr><tr bgcolor='#dfdfdf'><td>Spyware Virus</td><td>\$$scdvirus</td><td>[url='virus.php?action=msvirus']Do[/url]</td></tr><tr bgcolor='lightsteelblue'><td>Polymorphic Virus</td><td>\$$pcvirus</td><td>[url='virus.php?action=mpvirus']Do[/url]</td>
</tr><tr bgcolor='#dfdfdf'><td>Firewalk virus</td><td>\$$fcvirus</td><td><a href='virus.php?action=mfvirus'>Do</td>
</tr><tr bgcolor='lightsteelblue'><td>Trojan virus</td><td>\$$tcvirus</td><td><a href='virus.php?action=mtvirus'>Do</td></tr></table>";}
function makeavirus()
{
global $ir,$c,$userid,$h;
$avirus = "15";
$acvirus = "100";
$advirus = "20";
$rand=(int) (rand(1,2));
if ($rand==1)
{ echo "You failed to make the Adware virus you where busted trying";
mysql_query("UPDATE users SET jail=jail+$avirus, jailreason='Busted trying to make a Adware Virus' WHERE userid=$userid", $c);
}
if ($rand==2)
{echo "You Start Making A Adware Virus It Will Be Done In $advirus Days";
mysql_query("UPDATE users SET avdays=avdays+$advirus, money=money-$acvirus WHERE userid=$userid", $c) or die(mysql_error());
}}
function makesvirus()
{
global $ir,$c,$userid,$h;
$svirus="25";
$scdvirus = "150";
$sdvirus="50";
$rand=(int) (rand(1,2));
if ($rand==1)
{ echo "You failed to make the Spyware virus you where busted trying";
mysql_query("UPDATE users SET jail=jail+$svirus, jailreason='Busted trying to make a Spyware Virus' WHERE userid=$userid", $c);
}
if ($rand==2)
{echo "You Start Making A Spyware Virus It Will Be Done In $sdvirus Days";
mysql_query("UPDATE users SET svdays=svdays+$sdvirus, money=money-$scdvirus WHERE userid=$userid", $c) or die(mysql_error());
}}
function makepvirus()
{
global $ir,$c,$userid,$h;
$pvirus="30";
$pcvirus="200";
$pdvirus="100";
$rand=(int) (rand(1,2));
if ($rand==1)
{ echo "You failed to make the Polymorphic virus you where busted trying";
mysql_query("UPDATE users SET jail=jail+$pvirus, jailreason='Busted trying to make a Polymorphic Virus' WHERE userid=$userid", $c);
}
if ($rand==2)
{echo "You Start Making A Polymorphic Virus It Will Be Done In $pdvirus Days";
mysql_query("UPDATE users SET pvdays=pvdays+$pdvirus, money=money-$pcvirus WHERE userid=$userid", $c) or die(mysql_error());
}}
function makefvirus()
{
global $ir,$c,$userid,$h;
$fvirus="35";
$fcvirus="250";
$fdvirus="150";
$rand=(int) (rand(1,2));
if ($rand==1)
{ echo "You failed to make the Firewalk virus you where busted trying";
mysql_query("UPDATE users SET jail=jail+$fvirus, jailreason='Busted trying to make a Firewalk Virus' WHERE userid=$userid", $c);
}
if ($rand==2)
{echo "You Start Making A Firewalk Virus It Will Be Done In $fdvirus Days";
mysql_query("UPDATE users SET fvdays=fvdays+$fdvirus, money=money-$fcvirus WHERE userid=$userid", $c) or die(mysql_error());
}}
function maketvirus()
{
global $ir,$c,$userid,$h;
$tvirus="40";
$tcvirus="300";
$tdvirus="200";
$rand=(int) (rand(1,2));
if ($rand==1)
{ echo "You failed to make the Trojan virus you where busted trying";
mysql_query("UPDATE users SET jail=jail+$tvirus, jailreason='Busted trying to make a Trojan Virus' WHERE userid=$userid", $c);
}
if ($rand==2)
{echo "You Start Making A Trojan Virus It Will Be Done In $tdvirus Days";
mysql_query("UPDATE users SET tvdays=tvdays+$tdvirus, money=money-$tcvirus WHERE userid=$userid", $c) or die(mysql_error());
}}
?>
then make a file called buycomputer.php in it put:
<?php
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();
if ($ir['level'] <14)
{echo "Your Level Is To Low You Need To Be Level 15 Or Up To Buy A Computer"; EXIT;}
if ($ir['computer'] ==1)
{echo "You Already Own A Computer You Dont Need Another"; EXIT;}
switch ($_GET['action'])
{
case 'buypcy': buycomputer(); break;
case 'buypcn': buycomputer2(); break;
default: index(); break;
}
function index()
{echo "Would you like to buy a computer?
It will cost $5,000 if you dont got the money you will go into dept
[url='buycomputer.php?action=buypcy']Yes[/url]
[url='buycomputer.php?action=buypcn']No[/url]
";}
function buycomputer()
{
global $ir,$c,$userid,$h;
echo "You have purchased a computer for $5,000
[url='index.php']>Back[/url]
";
mysql_query("UPDATE users SET money=money-5000, computer=1 WHERE userid=$userid");}
function buycomputer2()
{echo "Ok Maybe Next Time
[url='index.php']>Home[/url]
";}
?>
then somewhere in index.php add:
if ($ir['level'] >14) {if ($ir['computer'] ==0) { echo "[url='buycomputer.php']Click Here To Buy A Computer[/url]";}
else if ($ir['computer'] ==1) { echo "[url='virus.php']Use Your Computer[/url]";}}
then run these query's
ALTER TABLE `users` ADD `computer` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `avdays` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `avsdone` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `svdays` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `svsdone` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `pvdays` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `pvsdone` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `fvdays` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `fvsdone` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `tvdays` int(11) NOT NULL default '0';
ALTER TABLE `users` ADD `tvsdone` int(11) NOT NULL default '0';
and in your day cron file add
$av=mysql_query("SELECT * FROM users WHERE avdays=1",$c);
while($r=mysql_fetch_array($av))
{
$userid=$r['userid'];
if ($r['avdays'] ==1)
{
mysql_query("INSERT INTO inventory VALUES('',109,$userid,1)",$c) or die(mysql_error());
mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you have made the Adware Virus!')",$c);
mysql_query("UPDATE users SET avsdone=avsdone+1 WHERE userid=$userid", $c);
}}
$sv=mysql_query("SELECT * FROM users WHERE svdays=1",$c);
while($r=mysql_fetch_array($sv))
{
$userid=$r['userid'];
if ($r['svdays'] ==1)
{
mysql_query("INSERT INTO inventory VALUES('',110,$userid,1)",$c) or die(mysql_error());
mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you have made the Spyware Virus!')",$c);
mysql_query("UPDATE users SET svsdone=svsdone+1 WHERE userid=$userid", $c);
}}
$pv=mysql_query("SELECT * FROM users WHERE pvdays=1",$c);
while($r=mysql_fetch_array($pv))
{
$userid=$r['userid'];
if ($r['pvdays'] ==1)
{
mysql_query("INSERT INTO inventory VALUES('',111,$userid,1)",$c) or die(mysql_error());
mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you have made the Polymorphic Virus!')",$c);
mysql_query("UPDATE users SET pvsdone=pvsdone+1 WHERE userid=$userid", $c);
}}
$fv=mysql_query("SELECT * FROM users WHERE fvdays=1",$c);
while($r=mysql_fetch_array($fv))
{
$userid=$r['userid'];
if ($r['fvdays'] ==1)
{
mysql_query("INSERT INTO inventory VALUES('',112,$userid,1)",$c) or die(mysql_error());
mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you have made the Firewalk Virus!')",$c);
mysql_query("UPDATE users SET fvsdone=fvsdone+1 WHERE userid=$userid", $c);
}}
$tv=mysql_query("SELECT * FROM users WHERE tvdays=1",$c);
while($r=mysql_fetch_array($tv))
{
$userid=$r['userid'];
if ($r['tvdays'] ==1)
{
mysql_query("INSERT INTO inventory VALUES('',113,$userid,1)",$c) or die(mysql_error());
mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you have made the Trojan Virus!')",$c);
mysql_query("UPDATE users SET tvsdone=tvsdone+1 WHERE userid=$userid", $c);
}}
ok you are done :p and ya i know there is better ways to do it bla bla if you are gona be rude please dont say anything if you have any problems please post here