twist_killer Posted March 27, 2007 Posted March 27, 2007 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 "; Quote
twist_killer Posted March 28, 2007 Author Posted March 28, 2007 Re: streets (help) plz people i need help Quote
UCC Posted March 28, 2007 Posted March 28, 2007 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: Quote
twist_killer Posted March 28, 2007 Author Posted March 28, 2007 Re: streets (help) can anyone else help me plz? Quote
kronow Posted March 28, 2007 Posted March 28, 2007 Re: streets (help) wtf is that... where you get that from? lmao :mrgreen: whats with # this # that Quote
ignite Posted March 29, 2007 Posted March 29, 2007 Re: streets (help) Why don't you just add a chance were you go to hospital ? Quote
twist_killer Posted March 29, 2007 Author Posted March 29, 2007 Re: streets (help) if woul'd show me how to..i'd so so Quote
ignite Posted March 29, 2007 Posted March 29, 2007 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). Quote
twist_killer Posted March 29, 2007 Author Posted March 29, 2007 Re: streets (help) at the momment all the 100 steps go at once..do u know how to make it 1 at a time? Quote
ignite Posted March 29, 2007 Posted March 29, 2007 Re: streets (help) Make sure the value on the submit button is 1 Quote
UCC Posted March 29, 2007 Posted March 29, 2007 Re: streets (help) Easily hackable. You'd want to make sure the value stayed 1 after they submit or give an error. Quote
twist_killer Posted March 29, 2007 Author Posted March 29, 2007 Re: streets (help) so to do 1 step at a time u place value 1? Quote
erus Posted February 26, 2008 Posted February 26, 2008 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 Quote
Scylla Posted March 12, 2008 Posted March 12, 2008 Re: streets (help) this is cool the way you set it up..... i plan to make use of it... thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.