Jump to content
MakeWebGames

{Request}Streets


pitbull305

Recommended Posts

Well guys i was hoping that someone could code a better streets then the lame one at mccodes ill post the code for mccodes one down here but if someone could make a way better one and more attactive and better scripted that would rock thanks and here the code

<?php
include "globals.php";
print "<h3>You are currently scavenging the streets</h3>


";
if ($_GET['action'] != 'scavenge') {
$turns=$ir['turns'];
print "Holy smokes! You should scavenge for some serious shit dude. Maybe grab some money off the ground, or get some Experience... maybe even find a special item or two...? Start goin! You have {$turns} turns left for today and will be topped up to 100 at newday.
";
print "

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

"); 
}else { 
$chance = rand(1,15); 
$db->query("UPDATE users SET turns=turns-1 where userid=$userid",$c); 
if ($chance == 1)  { 
 $amnt=rand(50,200); 
 if($ir['money'] > $amnt) 
  { 
print "As you scavenge the streets you see a hobo; he asks you for \$$amnt and you tell him to piss off. Then he proceeds to smack the shit out of you. He takes the  \$$amnt anyway.

"; 
$db->query("UPDATE users SET money=money- {$amnt } where userid=$userid",$c); 
$ir['money']-=$amnt; 
  } 
 else 
  { 
   print "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.

"; 
   $db->query("UPDATE users SET money=0 where userid=$userid",$c); 
   $ir['money']=0; 
  } 
} 
if ($chance == 2)  { 
print "Nothing here.

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

"; 
$db->query("UPDATE users SET money=money+$gained where userid=$userid",$c); 
} 
if ($chance == 7)  { 
print "You see a guy getting mugged, but 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 hobo came quickly behind you and whacked you over the head. You lurch in suprise and the hobo takes the cash and runs off."; 
} 
if ($chance == 5)  { 
$gain = rand(5,20); 
print "While searching the streets you found [b]$gain[/b] crystals."; 
$db->query("UPDATE users SET crystals=crystals+$gain where userid=$userid",$c); 
}  
if ($chance == 6)  { 
$gain = rand(50,100)*(floor($ir['level']/2)+1); 
print "While searching the streets you found [b] \$$gain[/b].

"; 
$db->query("update users set money=money+$gain where userid=$userid",$c); 
} 
if ($chance == 8)  { 
print "Nothing here. Just a few drunk bums.

"; 
} 
if ($chance == 9)  { 
print "You see a small item on the ground, and decide to pick it up... wonder what it is? (Hint, look in your inventory lol)";  
  $itemidexplore = 15; 
  $db->query("INSERT INTO inventory   VALUES('',$itemidexplore,$userid,1)",$c); ><rint"<br / br />"; 
} 
if ($chance == 10)  { 
print "You see a syringe on the ground, and decide to pick it up. Looks deadly enough...";  
  $itemidexplore = 57; 
  $db->query("INSERT INTO inventory   VALUES('',$itemidexplore,$userid,1)",$c); ><rint"<br / br />"; 

print"

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

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

"; 
} 
if ($chance == 13)  { 
$expcur=(($ir['exp']+$ir['exp_needed'])/100); 
$exp=(($expcur)*rand(1,5)); 
print "You got in a scuffle with a bum, and WON you gained some EXP!! (Go have a look!)

"; 
$db->query("UPDATE users SET exp=exp+$exp WHERE userid=$userid",$c); 
} 
if ($chance == 14)  { 
print "Nothing here.

"; 
} 
if ($chance == 15)  { 
$hosptime=(int) rand(1,5); 
$loseruser = $ir['userid']; 
$reasonhosp = 'Stepped on a land mine while scavenging.'; 
$db->query("UPDATE users SET hospital=$hosptime WHERE userid=$loseruser",$c); 
$db->query("UPDATE users SET hospreason='$reasonhosp' WHERE userid=$loseruser",$c); 
event_add($ir['userid'],"You stepped on a land mine while exploring. Do be a bit more careful next time...",$c); 
die ("You stepped on a land mine. 
[b]Good news[/b]: You aren't dead
[b]Bad News[/b]:You have to stop exploring and go into Recovery

");  
} 
$ir['turns']--; 
print"you have [b] {$ir['turns'] }[/b] steps left

"; 
} 
} 
if($ir['turns']==0) 
{ 
 print "Sorry, all turns used!

"; 
} 
else 
{ 
 print "

<form method=post action=streets.php?action=scavenge><input type=hidden name=action value=scavenge><input type='text' name='steps' value=' {$ir['turns'] }'>
<input type=submit value='scavenge'></form>"; 
} 
} 
$h->endpage; 
?> 
Link to comment
Share on other sites

Re: {Request}Streets

 

Why dont you learn some basic (x)html / css / php, and edit that one, it basic stuff tbh.

well, accualy, if you think about it, it depends what he wants to improve on it. ie if he wanted to change the randoms of something then i guess its basic, but adding a picture anit so simple, ive tried and it has never worked for me.

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.

×
×
  • Create New...