Jump to content
MakeWebGames

Help Re Doing Search an area Modd


jds137
 Share

Recommended Posts

A former coder left this on my site, and after looking at I feel it has potential to be really great. It lets you search an area by using a set of arrow keys. I dont know how to add em, right now its all screwed up. Anyone wanna tackle making this better, then we can give it away to CE members?

 

<?php

include "globals.php";
if(!$_GET['searching'])
{

// Begin Static Display

// Display header
print "<h1>
<center>
[b]
<font color=red>
Welcome To Sir Smigs Castle Where You Can Go To Find Stuff.
</font>
[/b]
</center>
</h1>

";

// Display 2 discreption of choices
print "<h3>
<center>
[b]
<font color=blue>
You are standing in a room with several Directions you can go. Which way will you choose.
</font>
[/b]
</center>
</h3>

";

// Directions
print "<center>Directions To Walk</center>
<center><table border='0' class='table' width='20%' bordercolor='#939393'><tr background='tablehgrad.png'>
<td><center>[url='castle.php?searching=hope']left foward[/url]</td><td><center>[url='castle.php?searching=i']foward[/url]</td><td><center>[url='castle.php?searching=love']right foward[/url]</td></tr><tr>
<td><center>[url='castle.php?searching=you']left[/url]</td><td><center>[url='castle.php?searching=but']up[/url]</td><td><center>[url='castle.php?searching=youve']right[/url]</td></tr><tr>
<td><center>[url='castle.php?searching=hurt']left backword[/url]</td><td><center>[url='castle.php?searching=me']backword[/url]</td><td><center>[url='castle.php?searching=deeply']right backword[/url]</td></tr><tr>
</table>
";

// End Static Display

}
else
{

// Begin Dynamic Display

// Hope	
if ($_GET['searching'] == 'hope') {
if($ir['castle'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// I
if ($_GET['searching'] == 'i') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// Love
if ($_GET['searching'] == 'love') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// You
if ($_GET['searching'] == 'you') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// But
if ($_GET['searching'] == 'but') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// Youve
if ($_GET['searching'] == 'youve') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// Hurt
if ($_GET['searching'] == 'hurt') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// Me
if ($_GET['searching'] == 'me') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}

// Deeply
if ($_GET['searching'] == 'deeply') {
if($ir['walking'] ==0)
	{
		mysql_query("UPDATE users SET will=will-0,energy=energy-0,money=money-0 WHERE userid=$userid",$c);
		print "You Have no Steps Left you can try Again at new day. [url='index.php']back[/url]!";
	}
else
$mel=rand(1,5);

if ($mel==1) {

print "You walk down the hall way and dont find anything. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}

if ($mel==2) {

print "You walk down the hall way and fall into a deep pit. When you come to your in the hospital. [url='index.php']Home[/url]";
$db->query("update users set castle=castle-1,hospital=60,hospreason='Fell into a deep pit in Sir Smigs Castle.',money=money-0 where userid=$userid");
}
if ($mel==3) {

print "You walk down the hall way and dont find your way out, but you find 3 tokens. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
$db->query("update users set tokens=tokens+3 where userid=$userid");
}
if ($mel==4) {

print "You walk down the hall way and dont find your way out, but you find some money. [url='castle.php']Continue Searching[/url]";
$db->query("update users set castle=castle-1,money=money+1234 where userid=$userid");
}
if ($mel==5) {

print "You walk down the hall way and you find nothing. [url='castle.php']Home[/url]";
$db->query("update users set castle=castle-1 where userid=$userid");
}
}






}

$h->endpage();
?>

 

db part thats needed walking int 11 not null 50

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...