Danny696
Members-
Posts
2,632 -
Joined
-
Last visited
-
Days Won
5
Content Type
Profiles
Forums
Events
Everything posted by Danny696
-
Re: I need help with a Mod i made heres an updated one that last one didnt give you money or steps didnt go down: streets.php <?php include(DIRNAME(__FILE__) . '/globals.php'); if($ir['jail']) { echo "<div align='center'>You see some bins outside your cell and you remember where they are so you can visit when you get out of [b]Jail[/b]</div>"; echo "<div align='center'>Go Back To <a href='jail.php'>Jail</div>"; $h->endpage(); exit; } if($ir['hospital']) { echo "<div align='center'>You see a bin next to you bed and start to look in it then the nurse comes in and sedates you</div>"; echo "<div align='center'>Go Back To <a href='hospital.php'>Hospital</div>"; $h->endpage(); exit; } if(!$ir['turns']) { echo "You do not have enough steps to scavenge the streets any more. Come back at newday. "; $h->endpage(); exit; } $expgained = (mt_rand(20,90) * $ir['street_level']); $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case 'street1' : street_1(); break; case 'street2' : street_2(); break; case 'street3' : street_3(); break; case 'street4' : street_4(); break; case 'street5' : street_5(); break; default : street_index(); break; } function street_index() { global $ir, $userid; $min_perc = ($ir['street_exp'] / $ir['street_needed'] * 100); echo "<div style='text-align:center;'>You are currently scavenging the streets. You can find everything here from money and crystals, to items and experience "; echo sprintf("Your street level is %s and you have %s/%s (%s%%) mining experience", number_format($ir['street_level']), number_format($ir['street_exp']), number_format($ir['street_needed']), $min_perc); echo "</div>"; echo "<div align='center'> <u>Street Levels</u> [[url='streets.php?action=street1']Level 1 streets[/url]] [[url='streets.php?action=street2']Level 10 streets[/url]] [[url='streets.php?action=street3']Level 20 streets[/url]] [[url='streets.php?action=street4']Level 30 streets[/url]] [[url='streets.php?action=street5']Level 40 streets[/url]] "; } function street_1() { global $ir, $db, $userid; $chance = mt_rand(1,3); if($chance == 1) { $amnt = mt_rand(50,200); if($ir['money'] > $amnt) { echo sprintf("As you scavenge the streets you see a hobo; he asks you for \$%u and you tell him to piss off. Then he proceeds to smack the cr*p out of you. He takes the \$%s anyway. ", $amnt, $amnt); takecash($amnt); } else { echo "As you walk the streets you see a hobo he asks you for \$1. You tell him to piss off, and he smacks you over the head and looks in your wallet. Finding it almost empty he just runs off with it. "; takecash($ir['money']); } } else if($chance == 2) { nothing(); } else { $gained = mt_rand(20,90); echo sprintf("You found a bag of cash on the side walk you open it up and find [b]\$%s[/b] was inside. ", number_format($gained)); givecash($gained); } turndown(1); } function street_2() { global $ir, $db, $userid; if($ir['level'] < 10) { echo "You are not a high enough level"; $h->endpage(); exit; } $rand = mt_rand(1,2); if($rand == 1) { $hosptime = mt_rand(1,5); $reasonhosp = 'Stepped on a land mine while scavenging.'; $sql = sprintf("UPDATE users SET hospital = %u, hospreason = '%s', hp = (maxhp / 7) WHERE (userid = %u)", $hosptime, $reasonhosp, $userid); $db->query($sql); echo "You stepped on a land mine. "; echo "[b]Good news[/b]: You aren't dead "; echo "[b]Bad News[/b]: You have to stop exploring and go into Hospital "; } else { $gain = mt_rand(5,20); echo sprintf("While searching the streets you found [b]%s[/b] crystals.", $gain); givecrystals($gain); } turndown(1); } function street_3() { global $db, $ir, $userid; if($ir['level'] < 20) { echo "You are not a high enough level"; $h->endpage(); exit; } $fluff = mt_rand(1,3); if($fluff == 1) { $gain = mt_rand(50,100) * (floor($ir['level'] / 2) + 1); echo sprintf("While searching the streets you found [b]\$%s[/b]. ", number_format($gain)); givecash($gain); } else if($fluff == 2) { nothing(); } else if($fluff == 3) { $jailtime = mt_rand(1,5); $reasonjail = 'Got Lured By The Police.'; $sql = sprintf("UPDATE users SET jail = %u, jail_reason = '%s' WHERE (userid = %u)", $jailtime, $userid); $db->query($sql); echo "You find a bag of crystals...It was a lure by the police! Looks like jail time for you. "; } turndown(1); } function street_4() { global $ir, $db, $userid; if($ir['level'] < 30) { echo "You are not a high enough level"; $h->endpage(); exit; } $random = mt_rand(1,2); if($random == 1) { $item = $db->fetch_single($db->query("SELECT itmid FROM items WHERE (itmbuyable = 1) ORDER BY RAND() LIMIT 1")); echo "You see a small item on the ground, and decide to pick it up... wonder what it is? (Hint, look in your inventory)"; item_add($userid, $item, 1); exp_gain(); } if($random == 2) { echo "You see something on the ground, and decide to pick it up. Looks deadly enough..."; $item = $db->fetch_single($db->query("SELECT itmid FROM items WHERE (itmbuyable = 1) ORDER BY RAND() LIMIT 1")); item_add($userid, $item, 1); exp_gain(); } turndown(1); } function street_5() { global $db, $ir, $userid; if($ir['level'] < 40) { echo "You are not a high enough level"; $h->endpage(); exit; } $erm = mt_rand(1,5); if($erm == 1) { $gain = ($ir['turns'] / 7); echo sprintf("You gain [b]%u[/b] steps!", $gain); $sql = sprintf("UPDATE users SET turns = turns + %u WHERE (userid = %u)", $gain, $userid); exp_gain(); } else if($erm == 2) { nothing(); } else if($erm == 3) { $expcur = (($ir['exp'] + $ir['exp_needed']) / 100); $exp = (($expcur) * mt_rand(1,5)); echo "You got in a scuffle with a bum, and WON you gained some EXP!! (Go have a look!) "; $sql = sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u)", $exp, $userid); $db->query($sql); exp_gain(); } else if ($erm == 4) { nothing(); } else if ($erm == 5) { nothing(); } turndown(1); } $ir['turns']--; echo sprintf(" You have [b]%u[/b] steps left ", $ir['turns']); if(!$ir['turns']) { echo "Sorry, all turns used! Go Back [url='index.php']Home[/url] </div>"; } else { echo "<form action='street.php?action=scavenge' method='post'>"; echo "<input type='hidden' name='action' />"; echo sprintf("<input type='text' name='steps' value='%u' /> ", $ir['turns']); echo "<input type='submit' value='Scavenge' />"; echo "</form>"; } function nothing() { $rand = mt_rand(1,4); if($rand == 1) { echo "Nothing here! "; } else if($rand == 2) { echo "You see a guy getting mugged, but you decide to keep walking. You don't want to be in his shoes anytime soon. "; } else if($rand == 3) { echo "Nothing to see here! "; } else { echo "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."; } } function exp_gain() { global $exp_gained, $db, $userid; $sql = sprintf("UPDATE users SET street_exp = street_exp + %u WHERE (userid = %u)", $exp_gained, $userid); $db->query($sql); } function takecash($money) { global $db, $ir, $exp_gained, $userid; $takemoney = sprintf("UPDATE users SET money = money - %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $exp_gained, $userid); $db->query($takemoney); } function givecash($money) { global $db, $ir, $exp_gained, $userid; $givecash = sprintf("UPDATE users SET money = money + %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $exp_gained, $userid); $db->query($givecash); } function givecrystals($crystals) { global $db, $ir, $exp_gained, $userid; $givecrystals = sprintf("UPDATE users SET crystals = crystals + %u, street_exp = street_exp + %u WHERE (userid = %u)", $crystals, $exp_gained, $userid); $db->query($givecrystals); } function givecash_crystals($money, $crystals) { global $db, $ir, $exp_gained, $userid; $finance = sprintf("UPDATE users SET money = money + %u, crystals = crystals + %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $crystals, $exp_gained, $userid); $db->query($finance); } function turndown($amnt) { global $db, $userid; $sql = sprintf("UPDATE users SET turns = turns - 1 WHERE (userid = %u)", $userid); $db->query($sql); } $h->endpage; ?> Sql Bits: ALTER TABLE `users` ADD `street_level` INT(3) UNSIGNED NOT NULL DEFAULT '1'; ALTER TABLE `users` ADD `street_exp` INT(11) NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `street_needed` INT(11) NOT NULL DEFAULT '100'; ALTER TABLE `users` ADD `turns` TINYINT(2) UNSIGNED NOT NULL DEFAULT '25'; Credits: Madgictallguy ~ Writing the code Karlos ~ Writing the Sql
-
Re: 3 Word Game of a big // some one say dildo
-
Re: 3 Word Game while having sex
-
Re: 3 Word Game go and have
-
Re: 3 Word Game and it tasted // lmao
-
Re: Things A Goverment Official Wont Say.... lets lower the tax
-
Re: FIRST THOUGH! cadburys
-
Re: 3 Word Game no but i
-
Re: Count Backwards :D it went from 4870 to 4769 to 4768 4567 4576 4575 wat heppened ppl let me guess learnt to code but no count 4765
-
Re: Rise Of Lycans wow this has gone offtopic
-
Re: I need help with a Mod i made on a different fourm madgictallguy edited/re-made it for me heres th codes: <?php include(DIRNAME(__FILE__) . '/globals.php'); if($ir['jail']) { echo "<div align='center'>You see some bins outside your cell and you remember where they are so you can visit when you get out of [b]Jail[/b]</div>"; echo "<div align='center'>Go Back To <a href='jail.php'>Jail</div>"; $h->endpage(); exit; } if($ir['hospital']) { echo "<div align='center'>You see a bin next to you bed and start to look in it then the nurse comes in and sedates you</div>"; echo "<div align='center'>Go Back To <a href='hospital.php'>Hospital</div>"; $h->endpage(); exit; } if(!$ir['turns']) { echo "You do not have enough steps to scavenge the streets any more. Come back at newday. "; $h->endpage(); exit; } $expgained = (mt_rand(20,90) * $ir['street_level']); $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case 'street1' : street_1(); break; case 'street2' : street_2(); break; case 'street3' : street_3(); break; case 'street4' : street_4(); break; case 'street5' : street_5(); break; default : street_index(); break; } function street_index() { global $ir, $userid; $min_perc = ($ir['street_exp'] / $ir['street_needed'] * 100); echo "<div style='text-align:center;'>You are currently scavenging the streets. You can find everything here from money and crystals, to items and experience "; echo sprintf("Your street level is %s and you have %s/%s (%s%%) mining experience", number_format($ir['street_level']), number_format($ir['street_exp']), number_format($ir['street_needed']), $min_perc); echo "</div>"; echo "<div align='center'> <u>Street Levels</u> [[url='streets.php?action=street1']Level 1 streets[/url]] [[url='streets.php?action=street2']Level 10 streets[/url]] [[url='streets.php?action=street3']Level 20 streets[/url]] [[url='streets.php?action=street4']Level 30 streets[/url]] [[url='streets.php?action=street5']Level 40 streets[/url]] "; } function street_1() { global $ir, $db, $userid; $chance = mt_rand(1,3); if($chance == 1) { $amnt = mt_rand(50,200); if($ir['money'] > $amnt) { echo sprintf("As you scavenge the streets you see a hobo; he asks you for \$%u and you tell him to piss off. Then he proceeds to smack the cr*p out of you. He takes the \$%s anyway. ", $amnt, $amnt); takecash($amnt); $ir['money'] -= $amnt; } else { echo "As you walk the streets you see a hobo he asks you for \$1. You tell him to piss off, and he smacks you over the head and looks in your wallet. Finding it almost empty he just runs off with it. "; takecash($ir['money']); } } else if($chance == 2) { nothing(); } else { $gained = mt_rand(20,90); echo sprintf("You found a bag of cash on the side walk you open it up and find [b]\$%s[/b] was inside. ", number_format($gained)); givemoney($gained); } } function street_2() { global $ir, $db, $userid; $rand = mt_rand(1,2); if($rand == 1) { $hosptime = mt_rand(1,5); $reasonhosp = 'Stepped on a land mine while scavenging.'; $sql = sprintf("UPDATE users SET hospital = %u, hospreason = '%s', hp = (maxhp / 7) WHERE (userid = %u)", $hosptime, $reasonhosp, $userid); $db->query($sql); echo "You stepped on a land mine. "; echo "[b]Good news[/b]: You aren't dead "; echo "[b]Bad News[/b]: You have to stop exploring and go into Hospital "; } else { $gain = mt_rand(5,20); echo sprintf("While searching the streets you found [b]%s[/b] crystals.", $gain); givecrystals($gain); } } function street_3() { global $db, $ir, $userid; $fluff = mt_rand(1,3); if($fluff == 1) { $gain = mt_rand(50,100) * (floor($ir['level'] / 2) + 1); echo sprintf("While searching the streets you found [b]\$%s[/b]. ", number_format($gain)); givemoney($gain); } else if($fluff == 2) { nothing(); } else if($fluff == 3) { $jailtime = mt_rand(1,5); $reasonjail = 'Got Lured By The Police.'; $sql = sprintf("UPDATE users SET jail = %u, jail_reason = '%s' WHERE (userid = %u)", $jailtime, $userid); $db->query($sql); echo "You find a bag of crystals...It was a lure by the police! Looks like jail time for you. "; } } function street_4() { global $ir, $db, $userid; $random = mt_rand(1,2); if($random == 1) { $item = $db->fetch_single($db->query("SELECT itmid FROM items WHERE (itmbuyable = 1) ORDER BY RAND() LIMIT 1")); echo "You see a small item on the ground, and decide to pick it up... wonder what it is? (Hint, look in your inventory)"; item_add($userid, $item, 1); exp_gain(); } if($random == 2) { echo "You see something on the ground, and decide to pick it up. Looks deadly enough..."; $item = $db->fetch_single($db->query("SELECT itmid FROM items WHERE (itmbuyable = 1) ORDER BY RAND() LIMIT 1")); item_add($userid, $item, 1); exp_gain(); } } function street_5() { global $db, $ir, $userid; $erm = mt_rand(1,5); if($erm == 1) { $gain = ($ir['turns'] / 7); echo sprintf("You gain [b]%u[/b] steps!", $gain); $sql = sprintf("UPDATE users SET turns = turns + %u WHERE (userid = %u)", $gain, $userid); exp_gain(); } else if($erm == 2) { nothing(); } else if($erm == 3) { $expcur = (($ir['exp'] + $ir['exp_needed']) / 100); $exp = (($expcur) * mt_rand(1,5)); echo "You got in a scuffle with a bum, and WON you gained some EXP!! (Go have a look!) "; $sql = sprintf("UPDATE users SET exp = exp + %u WHERE (userid = %u)", $exp, $userid); $db->query($sql); exp_gain(); } else if ($erm == 4) { nothing(); } else if ($erm == 5) { nothing(); } } $ir['turns']--; echo sprintf(" You have [b]%u[/b] steps left ", $ir['turns']); if(!$ir['turns']) { echo "Sorry, all turns used! Go Back<a href='index.php'>Home</div>Go "; } else { echo "<form action='street.php?action=scavenge' method='post'>"; echo "<input type='hidden' name='action' />"; echo sprintf("<input type='text' name='steps' value='%u' /> ", $ir['turns']); echo "<input type='submit' value='Scavenge' />"; echo "</form>"; } function nothing() { $rand = mt_rand(1,4); if($rand == 1) { echo "Nothing here! "; } else if($rand == 2) { echo "You see a guy getting mugged, but you decide to keep walking. You don't want to be in his shoes anytime soon. "; } else if($rand == 3) { echo "Nothing to see here! "; } else { echo "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."; } } function exp_gain() { global $exp_gained, $db, $userid; $sql = sprintf("UPDATE users SET street_exp = street_exp + %u WHERE (userid = %u)", $exp_gained, $userid); $db->query($sql); } function takecash($money) { global $db, $ir, $exp_gained, $userid; $takemoney = sprintf("UPDATE users SET money = money - %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $exp_gained, $userid); $db->query($takemoney); } function givecash($money) { global $db, $ir, $exp_gained, $userid; $givemoney = sprintf("UPDATE users SET money = money + %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $exp_gained, $userid); $db->query($givemoney); } function givecrystals($crystals) { global $db, $ir, $exp_gained, $userid; $givecrystals = sprintf("UPDATE users SET crystals = crystals + %u, street_exp = street_exp + %u WHERE (userid = %u)", $crystals, $exp_gained, $userid); $db->query($givecrystals); } function givemoney_crystals($money, $crystals) { global $db, $ir, $exp_gained, $userid; $finance = sprintf("UPDATE users SET money = money + %u, crystals = crystals + %u, street_exp = street_exp + %u WHERE (userid = %u)", $money, $crystals, $exp_gained, $userid); $db->query($finance); } $h->endpage; ?> And the MySql: ALTER TABLE 'users' ADD `street_level` int(11) NOT NULL DEFAULT 1; ALTER TABLE 'users' ADD `street_exp` int(11) NOT NULL DEFAULT 0; ALTER TABLE 'users' ADD 'street_needed` int(11) NOT NULL DEFAULT 100; ALTER TABLE 'users' ADD 'turns' int(11) NOT NULL DEFAULT 25;
-
Re: Rise Of Lycans well its not accucally my game and their gettin a new scripts soon
-
Re: [McCodes V2] Streets Mod wait it would be $db->query("UPDATE users ADD turns+5 WHERE turns < 101")
-
Re: Help Header Problem yo man the header in the login.php, register.php and the other pages are different sort it out man
-
[MCcodes All] Staff Members cannot be attacked.
Danny696 replied to Undergroundcity's topic in Free Modifications
Re: [MCcodes All] Staff Members cannot be attacked. one way people would know not to attack staff if you dont have any haha :evil: -
www.http://www.lycans.net tell me what you think its not my game i just know that owner
-
Re: 3 Word Game to eat my
-
Re: [REVIEW] Review my game plz. Fearless-Dojo haha lmao
-
Re: 3 Word Game and when he
-
Re: I need help with a Mod i made You should learn how to code PHP before you own a game im not makeing a game i just tried to make this for a game
-
Re: I need help with a Mod i made lmao any help with the leveld streets
-
Re: Which File Extension are You? im Which File Extension are You?</a>[/img]
-
Re: [REVIEW] Review my game plz. Fearless-Dojo OMG where did u get that banner from its amazing !!! *sarcasam*
-
Re: hey review my game im on it now it luks ok
-
Re: I need help with a Mod i made i was trying to make a leveled streets if anyone could make one and post it i could learn from wat you have done :-D