Jump to content
MakeWebGames

streets (help)


twist_killer
 Share

Recommended Posts

i just wanna add something like after all your steps...you end up in hospital for a random amount of time

}
if ($chance == 2) {
print "Nothing here.

";
}
if ($chance == 3) {
$gained=rand(20,90)*$ir['level'];
print "You found a wallet full of cash on the side walk. You open it up and find [b]\$$gained[/b] was inside.

";
mysql_query("update users set money=money+$gained where userid=$userid",$c);
}
if ($chance == 7) {
print "You see a two people knocking the shit out a helpless man ,  pretending that you didn't notice you decide to keep walking. You don't want to be in his shoes anytime soon.

";
}
if ($chance == 4) {
print "While exploring the streets you found some cash, but a thief comes quickly behind you and pulls out a knife. he asked you to give him the money but you refuse. He gets pissed so he knockes you unconconius and takes the money ";
Link to comment
Share on other sites

Re: streets (help)

Sorry that's not something you can do with just a couple lines of code. You might catch someone who is bored or you might have to pay for services.

I myself, dont even like to read code that has all that ASCII junk. :mrgreen:

Link to comment
Share on other sites

Re: streets (help)

if ($chance == 13) {

$hosptime=(int) rand(1,20);

$loseruser = $ir['userid'];

$reasonhosp = 'Got hit by a car while exploring the streets.';

mysql_query("UPDATE users SET hosptime=$hosptime WHERE userid=$userid",$c);

mysql_query("UPDATE users SET hospreason='$reasonhosp' WHERE userid=$userid",$c);

event_add($ir['userid'],"You walked across the street and a car was speeding. The car hit you HARD. You were sent to the Hospital",$c);

die ("While you were walking across the street, you got hit by a car.

Good news: You aren't dead

Bad News:You have to stop exploring and go into Recovery

");

Thats what i use (you will need to edit this to fit your code).

Link to comment
Share on other sites

  • 10 months later...

Re: streets (help)

This is the one i altered for my site

the steps have been boxed into a fieldset and the steps are taken one at a time

also stopped it searching while in jail or hospital

 

<?php
include "globals.php";
if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); 
$h->endpage ();
}
print "<img src=/imgs/riot.gif>


";
if ($_GET['action'] != 'scavenge') {
$turns=$ir['turns'];
print "<fieldset>
<legend>Holy smokes!</legend>

You should search for some serious shit dude. 

Maybe grab some money off the ground, or get some Experience... 

maybe even find a special item or two...? </fieldset>



<fieldset>Start going! You have {$turns} turns left for today and will be topped up to 25 at 00:00 GMT.</fieldset>
";
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Get Searching'></form>";
} else {
$steps=abs((int) $_POST['steps']);
for($i=0;$i<$steps;$i++)
{
if ($ir['turns'] < 1)  {
print("You do NOT have enough turns to search the streets any more. Come back at Midnight GMT.

");
}else {
$chance = rand(1,15);
$db->query("UPDATE users SET turns=turns-1 where userid=$userid",$c);
if ($chance == 1)  {
$amnt=rand(20,120);
if($ir['money'] > $amnt)
{
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>As you scavenge the streets you see a hobo; 

he asks you for<font color=green> \$$amnt </font>and you tell him to piss off. 

Then he proceeds to smack the shit out of you. He takes the  <font color=red>\$$amnt </font>anyway.
</fieldset>
";
$db->query("UPDATE users SET money=money- {$amnt } where userid=$userid",$c);
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$ir['money']-=$amnt; $h->endpage(); exit; 
}
else
{
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>As you walk the streets you see a hobo,

he asks you for \$1 you tell him to piss off he smacks you over the head and looks in your wallet. 

Finding it almost empty he just runs off with it.
</fieldset>
";
$db->query("UPDATE users SET money=0 where userid=$userid",$c);
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$ir['money']=0; $h->endpage(); exit; 
}
}
if ($chance == 2)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>As you are walking down the road you find <font color=Green>$20</font>.
But a gust of wind blows it from your hand.
</fieldset>
";
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit; 
}
if ($chance == 3)  {
$gained=rand(2,3)*$ir['level'];
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>You found a bag of cash on the side walk you open it up and find [b] <font color=green>\$$gained</font>[/b] was inside.
</fieldset>
";
$db->query("UPDATE users SET money=money+$gained where userid=$userid",$c);
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 7)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>You see a guy getting mugged, but you decide to keep walking. 
You don't want to be in his shoes anytime soon.
</fieldset>
";
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 4)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>While exploring the streets you found some cash,

but a hobo came quickly behind you and whacked you over the head. 

You lurch in suprise and the hobo takes the cash and runs off.
</fieldset>";
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 5)  {
$gain = rand(1,3);
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>While searching the streets you found <font color=green>[b]$gain[/b] Gold.</font>
</fieldset>";
$db->query("UPDATE users SET crystals=crystals+$gain where userid=$userid",$c); 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 6)  {
$gain = rand(2,5)*(floor($ir['level']/2)+1);
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>While searching the streets you found <font color=green>[b] \$$gain[/b]</font>.
</fieldset>
";
$db->query("update users set money=money+$gain where userid=$userid",$c); 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 8)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>Nothing here. Just a few drunk teenagers at the bus shelter.
</fieldset>
"; 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 9)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>You see a small item on the ground, and decide to pick it up... 


<font color=Green>(first aid kit)</font></fieldset>";
$itemidexplore = 2;
$db->query("INSERT INTO inventory VALUES('',5,$userid,1)",$c); print"

";
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 10)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>Nothing here. Just a few drunk teenagers at the bus shelter.
</fieldset>
"; 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 11)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>Nothing here.

</fieldset>"; 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 12)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>Nothing here.

</fieldset>"; 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 13)  {
$expcur=(($ir['exp']+$ir['exp_needed'])/100);
$exp=(($expcur)*rand(1,10));
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>You got in a scuffle with a tramp, and WON you gained <font color=Green>$exp EXP Points!!</font>
</fieldset>
";
$db->query("UPDATE users SET exp=exp+$exp WHERE userid=$userid",$c); 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 14)  {
print "<fieldset>
<legend>[b] {$ir['turns'] }[/b]</legend>Nothing here.

</fieldset>"; 
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value='{$ir['turns']}'>
<input type=submit value='Search Again'></form>";
$h->endpage(); exit;
}
if ($chance == 15)  {
$loseruser = $ir['userid'];
event_add($ir['userid'],"You came accross a group of chavs on a street corner, they start hitting you until you fall to the floor.",$c);
die ("You came accross a group of chavs on a street corner,

<font color=red>they start hitting you until you fall to the floor.</font> 

<font color=Green>[b]Good news[/b]: You aren't dead

</font><font color=red>[b]Bad News[/b]:You have to stop exploring and go into Recovery</font>


"); 
$db->query("UPDATE users SET hospital='7' WHERE userid=$loseruser", $c);
$db->query("UPDATE users SET hospreason='Head kicked in by a group of chavs' WHERE userid=$loseruser", $c);
$h->endpage(); exit;
}
$ir['turns']--;
}
}
$h->endpage ();
if($ir['turns']==0)
{
print "<font color=Red>Sorry, all turns used. Please come back at 00.00 GMT!</font>

";
}
else
{
print "

<form method=post action=street.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value=' {$ir['turns'] }'>
<input type=submit value='Get Searching'></form>";
}
}
$h->endpage ();
?>
'></form>";
}
}
$h->endpage ();
?>

 

hope someone finds it useful just never got round to making it insert the items correctly

Link to comment
Share on other sites

  • 2 weeks later...

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...