Jump to content
MakeWebGames

Search the Community

Showing results for tags 'mccode-v2'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • News and Announcements
    • Introductions
    • Feedback and Site Support
    • Collaboration Experiences
  • General Development Central
    • General
    • Game Support
    • Game Projects
    • Services
    • Web Developement
    • Art and Content
  • Game Engines
    • MCCodes
    • Generic RPG
    • Gangster Legends
    • Other Game Engines
  • Technics
    • PHP
    • MySQL, Oracle, Postgress or other DB
    • Web Design
    • Programming Tools, Software and much more
    • Other Programming
    • Linux and Webservers
    • JavaScript
  • Misc
    • General Gaming Discussion
    • Chit Chat
    • Fun & Games
    • Tech News
    • Question of the day
    • Media Entertainment (FKA Tv Shows)

Categories

  • MCCodes v2
    • Free
    • Paid
  • GRPG
  • Gangster Legends V2
    • Modules
    • Themes
  • Graphics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Interests


Occupation


Website

  1. I have absolutely no idea whether this has been done before, so here's my version of a Game Rules overhaul. Keep in mind, I did develop this originally for MTG Codes, figured it may be useful to someone, and converted it to MC Craps v2 - any errors, give me a shout. The usage is simple: Upload this gamerules.php, (be sure to make a copy of your current rules), run the SQL, continue as normal. gamerules.php <?php require_once __DIR__ . '/globals.php'; ?> <h1><?php echo stripslashes($set['game_name']); ?>: Rules and Regulations</h1><?php $_GET['ID'] = array_key_exists('ID', $_GET) && ctype_digit($_GET['ID']) && $_GET['ID'] > 0 ? $_GET['ID'] : null; $_GET['action'] = $_GET['action'] ?? null; switch ($_GET['action']) { case 'add': addRule($db, $ir, $h); break; case 'edit': modifyRule($db, $ir, $h); break; case 'delete': deleteRule($db, $ir, $h); break; default: ruleIndex($db, $ir); break; } function ruleIndex($db, $ir) { global $set; $count = 0; $width = (2 == $ir['user_level']) ? 85 : 95; $colspan = (2 == $ir['user_level']) ? 3 : 2; $select = $db->query('SELECT * FROM gameRules ORDER BY ruleID'); ?> <table class="table" style="width:100%;"> <thead> <tr> <th scope="col" style="width:5%;">#</th> <th scope="col" style="width:<?php echo $width; ?>;%">Rule</th> <?php if (2 == $ir['user_level']) { ?> <th style="width:10%;">Links &middot; <a href="gamerules.php?action=add"><img src="/silk/add.png" title="Add Rule" alt="Add"/></a></th> <?php } ?> </tr> </thead> <tbody> <?php if (!$db->num_rows($select)) { ?> <tr> <td colspan="<?php echo $colspan; ?>" style="text-align:center;">No rules have been set. Tell an admin to get their ass to it!</td> </tr> <?php } else { $playerName = $db->fetch_single($db->query('SELECT username FROM users WHERE (userid = 1)')); // Assuming that main admin is ID 1. Change to reflect your game $find = [ '{name}', '{owner}', ]; $repl = [ $set['game_name'], '<a href=\'viewuser.php?u=1\'>' . $playerName . '</a>', ]; while ($row = $db->fetch_row($select)) { ++$count; ?> <tr> <td><?php echo $count; ?></td> <td><?php echo str_replace($find, $repl, stripslashes($row['ruleText'])); ?></td> <?php if (2 == $ir['user_level']) { ?> <td> <a href="gamerules.php?action=edit&amp;ID=<?php echo $row['ruleID']; ?>"><img src='/silk/application_edit.png' title="Edit" alt="Edit"/></a> &middot; <a href="gamerules.php?action=delete&amp;ID=<?php echo $row['ruleID']; ?>"><img src="/silk/delete.png" title="Delete" alt="Delete"/></a> </td> <?php } ?> </tr> <?php } } ?> </tbody> </table><?php } function addRule($db, $ir, $h) { global $db, $ir, $h; if (2 != $ir['user_level']) { echo 'You don\'t have access to this'; exit($h->endpage()); } if (array_key_exists('submit', $_POST)) { $_POST['newRule'] = array_key_exists('newRule', $_POST) && is_string($_POST['newRule']) && strlen($_POST['newRule']) > 0 ? strip_tags(trim($_POST['newRule'])) : null; if (null !== $_POST['newRule']) { $selectDup = $db->query('SELECT COUNT(ruleID) FROM gameRules WHERE LOWER(ruleText) = "' . strtolower($db->escape($_POST['newRule'])) . '"'); if (!$db->fetch_single($selectDup)) { $db->query('INSERT INTO gameRules (ruleText) VALUES ("' . $db->escape($_POST['newRule']) . '")'); echo 'Your new rule has been added'; } else { echo 'That rule already exists'; } } else { echo 'You didn\'t enter a valid rule'; } } ?> <form action="gamerules.php?action=add" method="post"> <div class="form-group"> <label for="newRule">Rule</label> <textarea name="newRule" id="newRule" class="form-control" rows="7" autofocus required></textarea> </div> <button type="submit" name="submit" class="btn btn-primary"> <span class="fas fa-check"></span> Add Rule </button> </form> <?php ruleIndex($db, $ir); } function modifyRule($db, $ir, $h) { global $db, $ir, $h; if (2 != $ir['user_level']) { echo 'You don\'t have access to this'; exit($h->endpage()); } if (null === $_GET['ID']) { echo 'You didn\'t select a rule to modify'; exit($h->endpage()); } $select = $db->query('SELECT ruleText FROM gameRules WHERE ruleID = ' . $_GET['ID']); if (!$db->num_rows($select)) { echo 'That rule doesn\'t exist'; exit($h->endpage()); } $row = $db->fetch_row($select); if (array_key_exists('submit', $_POST)) { $_POST['ruleText'] = array_key_exists('ruleText', $_POST) && is_string($_POST['ruleText']) && $_POST['ruleText'] !== '' ? strip_tags(trim($_POST['ruleText'])) : null; if (null !== $_POST['ruleText']) { $selectDup = $db->query('SELECT COUNT(ruleID) FROM gameRules WHERE LOWER(ruleText) = "' . $db->escape($_POST['ruleText']) . '" AND ruleID <> ' . $_GET['ID']); if (!$db->fetch_single($selectDup)) { $db->query('UPDATE gameRules SET ruleText = "' . $db->escape($_POST['ruleText']) . '" WHERE ruleID = ' . $_GET['ID']); echo 'Rule edited'; ruleIndex($db, $ir); exit($h->endpage()); } else { echo 'That rule already exists'; } } else { echo 'You didn\'t enter a valid rule'; } } ?> <form action="gamerules.php?action=edit&amp;ID=<?php echo $_GET['ID']; ?>" method="post"> <div class="form-group"> <label for="ruleText">Rule</label> <textarea name="ruleText" id="ruleText" class="form-control" rows="10" autofocus required><?php echo stripslashes(htmlspecialchars($row['ruleText'])); ?></textarea> </div> <button type="submit" name="submit" class="btn btn-primary"> <span class="fas fa-check"></span> Edit Rule </button> </form> <?php ruleIndex($db, $ir); } function deleteRule($db, $ir, $h) { global $db, $ir, $h; if (2 != $ir['user_level']) { echo "You don't have access to this"; exit($h->endpage()); } if (null === $_GET['ID']) { echo 'You didn\'t select a rule to delete'; exit($h->endpage()); } $select = $db->query('SELECT ruleID FROM gameRules WHERE ruleID = ' . $_GET['ID']); if (!$db->num_rows($select)) { echo 'That rule doesn\'t exist'; exit($h->endpage()); } $db->query('DELETE FROM gameRules WHERE ruleID = ' . $_GET['ID']); echo 'Rule deleted'; ruleIndex($db, $ir); } $h->endpage(); SQL CREATE TABLE IF NOT EXISTS `gameRules` ( `ruleID` int(11) NOT NULL AUTO_INCREMENT, `ruleText` text NOT NULL, PRIMARY KEY (`ruleID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf_general_ci ; Now, for those of you using the bog standard rules, simply run this SQL *AFTER* running the previous one to create the table to insert the standard rules. INSERT INTO `gameRules` (`ruleID`, `ruleText`) VALUES (1, 'Players are only allowed to have one account, owning two or more accounts will result in all accounts being jailed,'), (2, 'if you are on the same IP as another player, mail staff and let them know.'), (3, 'You are responsible for whatever happens on your account, don\'t give out your password to anyone.'), (4, 'Children play this game, so keep it PG-13. Mild swearing will be permitted, but F-bombing, sexual vulgarities or excessive swearing will result in some time in Fed until you clean up your act.'), (6, 'Profile images with nudity, profanity, or otherwise offensive images will be removed, and may result in jail time.'), (7, 'We understand that you play other games, but do not advertise them here. You get 1 warning, afterwards its Fed time.'), (8, 'Do not spam the staff\'s mailbox, if you have a problem, message one of us once. They will deal with your problem in a timely manner, but do not mail them repeatedly, or mail multiple staff members.'), (9, 'Do not harrass other players, use common sense on this one, if you don\'t know when your crossing the line from fantasy into'), (10, 'harrassment, assume that you are harrassing the other player. This will not be tolerated and will result in a stiff punishment.'), (11, 'Scamming will not be tolerated in any manner. Any attempt to scam anyone will result in being jailed for a long long time.'), (12, 'If a member of staff is bothering you for any unfair or just plain, weird reason, mail {owner}'), (13, 'Common sense rules are not posted here, if you can\'t determine the difference between what is ok, and what is not, you should consider not interacting with other people until you do understand.'), (14, 'These rules are subject to change without notice, check them from time to time, as ignorance will not be accepted as an excuse.'); You will also need to upload 3 icons (from http://famfamfam.com 's Silk collection - add.png, edit.png, delete.png
  2. Hello everyone, I am starting back up again developing some mods and stumbled upon a post for gang kidnapping which I believe was from MTG. That mod brought up some memories of a game I first started playing that had that and thought to myself, what other cool mods did they have? I remembered that they had a mailbomb module that allows you to send a user a mailbomb if the user has the item. The receiver then has "X" amount of time to diffuse the bomb otherwise it blows up and when they attempt to diffuse it, they must pick the correct wire. I searched the forum and only found one mailbomb mod from back in '09 which is extremely outdated and made for V1 and looks like it has a bunch of unnecessary crap in it 😉. This module just hooks into your current mail system so if you want to send a user a bomb, you just check the box, type your message and hit send.
  3. I have decided to release my voting mod for free. Updates will continue to roll out for this mod if and when needed.
  4. Who's not made this mod? I just got the free copy of the forums and made it look a million times better and added a few things to it The code is too long to put on here so I'm going to show you some screen shots and if you like it then you can download it from the download link which is placed after the screen shots The Zip file includes; Instructions File (don't think you won't need it as theres a few sql's involved and a few database querys) honoraward.php HonorExchange.php 6 pages of Money Awards 5 pages of Crimes Awards 5 pages of Star/Crystal Awards 7 pages of Donator day Awards 5 pages of Gang Day Awards 5 pages of Days Old Awards 6 pages of Level Awards 5 pages of Attacks Won Awards Picture 1 - Just to show you how the tables are set out, theres more than 1 on every table but i just showed 1 to save my self from the long work Picture 2 - Shows What the Honor Exchange looks like Picture 3 - Well the old one was 'Award Credited Click Hereto go back to Honor awards'. Boooorrring, who doesn't agree? So i just made a little conversion with HarryB against the player. Change HarryB if you want i don't mind. www.deadly-planet.com/Honor-Award-Mod-Modified-By-HarryB.zip Hope you like it. Post your comments please.
  5. [align=center] [/align] Code has been updated/Patched. Version 1.1. Version 1.0 Released: 05-22-2010 11:20 PM Version 1.1 Released: 04-19-2011 11:49 PM Version 1.1.5 Released: 05-06-2011 22:13 PM Version 2.0 View Features Sorry for the wait. The original code had a few bugs, this is a patch. Not a full code makeover. This will soon to come. Feature List • Flexibility within file management o Allows easy editing o You can edit the most important parts of the modification very easily. • A whole president and vice president panel which includes many features o Cash Payment o Crystal Payment o Change Gang Picture o Change Gang Tag o Change Gang Name o Change Vice President o Change President* o Change Description o Delete Gang* o View Applications o Upgrade Spots Available in Gang o Mail All Members o View Items Lent to Members o Start A War o War Stats o Hit list A Gang o Surrender* *Requires Password Verification • A panel for the regular members (President and vice president can also view) o Vault o View Hit List o Attack Logs o War Stats o Donation Logs o Armoury o View Members o View Events • Other Features o Kill Death Ratio o Total War Kills File has been attached to an external site. If you do not trust that site, please PM me and i will email it to you. * I have signed the documentation, if the signature becomes invalid, the document may have been altered. Download Link: DropBox. Two zip'd folders. Top one is just documentation, bottom one is the whole thing *Thanks Djk for the DropBox. Read Replies from Here, other replies are for the 1.0 version. If you wish to download the patch 1.1.5 for version 1.1 please click Here. What this Patch Does It automatically copies your old data to the new system, which saves confusion and unwanted errors. * Includes documentation and instructions. Thanks for your time. - sniko Edit New download link (supplied by Djkanna) DOWNLOAD (View post)
  6. Hey folks. I've tried repeatedly to get error messages to show on a game that I'm working on. You know those messages that say something like "unexpected { or ;". Those kinds of messages. For that matter, I'm not getting any of the error messages to popup. When there is an error in the code, I'm just getting a blank white screen. Now, if it's a minimum number of lines of code, it's usually easy enough to find, right. But when you have a lot of lines of code, you can spend hours by blocking certain code, trying it, then unblocking the next and so on to find the error. Any ideas on what I can do to get this to work? Any help/suggestions would be greatly appreciated. Thanks a bunch.
  7. Run these SQLs to phpMyAdmin - CREATE TABLE IF NOT EXISTS `referrals` ( `refID` int(11) NOT NULL AUTO_INCREMENT, `refREFER` int(11) NOT NULL DEFAULT '0', `refREFED` int(11) NOT NULL DEFAULT '0', `refTIME` int(11) NOT NULL DEFAULT '0', `refREFERIP` varchar(15) NOT NULL DEFAULT '127.0.0.1', `refREFEDIP` varchar(15) NOT NULL DEFAULT '127.0.0.1', `refBONUS` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`refID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `referrals_reward` ( `refBONUS` int(11) NOT NULL AUTO_INCREMENT, `refLEVEL` int(11) NOT NULL DEFAULT '0', `refCOINS` int(11) NOT NULL, `refMONEY` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`refBONUS`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; INSERT INTO `referrals_reward` (`refBONUS`, `refLEVEL`, `refCOINS`, `refMONEY`) VALUES (0, 3, 250, 1000), (1, 10, 350, 5000), (2, 20, 450, 8000), (3, 35, 600, 12000), (4, 50, 800, 20000), (5, 70, 1000, 40000), (6, 90, 1300, 80000), (7, 120, 2000, 100000), (8, 150, 2500, 150000); Open up register.php and find the stock McCodes referral code and replace it with - $db->query( "INSERT INTO `referals` VALUES(NULL, {$_POST['ref']}, $i, " . time() . ", '{$e_rip}', '$IP', 0)"); Create a new file called referral.php and add the following code below - <?php require('globals.php'); echo " <h3><u>Referral Program</u></h3><br/> <ol> What is the referral program:<br />The referral program is a method of which members gain rewards for referring people to join {$set['game_name']}. <br /><br />How it works:<br />If you help build the community of players bigger and more loyal, you get rewarded!<br /> When you refer a friend to {$set['game_name']}, you'll be qualified for the Referral Program.<br /><br /> To refer people you need them to use either your referral link or have them enter your ID number at the register page.<br /><br /> Your link:<br />This is your referral link: http://{$domain}/register.php?REF={$userid}<br /><br /> Current obtained referrals:"; $query = $db->query("SELECT `refID`, `refTIME`, `refREFED` FROM `referrals` WHERE `refREFER` = {$ir['userid']}"); echo " <font color ='gold'>" . $db->num_rows($query) . "</font> </ol> <hr width='85%'> <table cellspacing='1' border='0' cellpadding='1' class='table' width='85%'> <tr> <th><b>Referred</b></th> <th><b>Time</b></th> <th><b>Level</b></th> </tr>"; $p = 0; while ($r = $db->fetch_row($query)) { $p++; $time = date('F j, Y g:i:s a', $r['refTIME']); $u = $db->query("SELECT `userid`, `level`, `username` FROM `users` WHERE `userid` = {$r['refREFED']}"); $user = $db->fetch_row($u); echo " <tr> <td>{$user['username']} [" . format($user['userid']) . "]</td> <td>{$time}</td> <td>" . format($user['level']) . "</td> </tr>"; } echo "</table><hr width ='85%'>"; echo "<br />My Reward:<br />The rewards system will credit you per member referred as follows: <br /><br /> Initial referral reward of <span style='color:green'>500 coins</span>.<br />"; $q = $db->query("SELECT * FROM `referrals_reward`"); while($reward = $db->fetch_row($q)) { echo "An additional reward of <span style='color:green'>{$reward['refCOINS']} coins</span> and <span style='color:green'>" . money_formatter($reward['refMONEY']) . "</span> when your referral reaches level {$reward['refLEVEL']}.<br />"; } echo "<br/>Rewards total so far:<br /> Money: <font color = 'gold'>Coming Soon</font><br/> Coins: <font color = 'gold'>Coming Soon</font><br/><br/> <h2><strong>Referral Help:</strong></h2> Listed below are just some methods to obtain referrals:<br /><br /> Post your referral link anywhere on the web. Post it on blogs, MySpace, Facebook, Twitter and any other site that allows you to add content.<br /> On Facebook type accounts, email people, post bulletins, write blogs, and post comments about {$set['game_name']} with your referral link.<br /> Youtube is also a good place to get referrals. Make a good video along with you referral link to your video and watch the referrals come in.<br /> Do you have Skype, MSN Messenger, Yahoo Messenger or any other instant messenger? Put you referral link in your name or profile.<br /> Key rule! If you have any account anywhere on the NET that permits advertising then add you referral link.<br /> Domain forwarding is also very effective. Low cost and ideal for anyone who has got an inactive domain name.<br /> CPC Adverting can be as cheap as 0.005 per click. If the rewards are worth the conversion then this maybe for you.<br /> When will I get credited?<br />Credits are made within the beginning of the hour. <hr width = '85%'><a href = 'explore.php'>>Explore</a><hr width = '85%'>"; $h->endpage(); ?> Add this into cron_hour.php - ///Referral cron $referral = $db->query("SELECT `refREFED`, `refREFER`, `refBONUS` FROM `referrals`"); while($ref = $db->fetch_row($referral)) { $user = $db->query("SELECT `userid`, `username`, `level` FROM `users` WHERE `userid` = {$ref['refREFED']}"); while($r = $db->fetch_row($user)) { $q = $db->query("SELECT * FROM `referrals_reward` WHERE `refBONUS` = {$ref['refBONUS']}"); $reward = $db->fetch_row($q); if($r['level'] > $reward['refLEVEL'] && $ref['refBONUS'] == $reward['refBONUS']) { $db->query("UPDATE `users` SET `coins`= `coins` + {$reward['refCOINS']}, `money`= `money` + {$reward['refMONEY']} WHERE `userid` = {$ref['refREFER']}"); $db->query("UPDATE `referrals` SET `refBONUS` = `refBONUS` + 1 WHERE `refREFER` = {$ref['refREFER']} AND `refREFED` = {$ref['refREFED']}"); event_add($ref['refREFER']," Your referral, <a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a>, has reach level {$reward['refLEVEL']}, you have been awarded {$reward['refCOINS']} coins and " . money_formatter($reward['refMONEY']) . "."); } } } [ATTACH=CONFIG]n280863[/ATTACH] [ATTACH=CONFIG]n280864[/ATTACH] Feedback will be good and thanks
  8. Ok this is quick Grow Weed mod. I didn't spend alot of time on this but i might have intentions to update this as it goes along. run these sql's ALTER TABLE `users` ADD `weed` int(11) NOT NULL DEFAULT '0', ADD `weedtime` int(11) NOT NULL DEFAULT '0', ADD `treatedweed` int(11) NOT NULL DEFAULT '0'; grow.php <?php include "globals.php"; if($ir['weedtime'] > 0) { echo "<h2>You have <font color='red'>{$ir['weedtime']}</font> Minutes until your weed is done.<br /><br /><a href='grow.php'>Reload</a>"; $h->endpage(); exit; } echo "<h2>Grow House</h2><br />"; switch($_GET['action']) { default: grow_index(); break; case "grow": grow_weed(); break; case "grow1": grow_weed1(); break; case "sell": grow_sell(); break; case "sell1": grow_sell1(); break; case "sellt": grow_sellt(); break; case "sellt1": grow_sellt1(); break; case "treat": grow_treat(); break; case "treat1": grow_treat1(); break; } function grow_index() { global $db,$ir,$c,$userid; echo " Welcome to your Grow Room.<br /><br /> <table class='table1' width='75%'><tr> <td align='center'>You have <b><font color='red'>{$ir['weed']}</font></b> weed</td></tr><tr> <td align='center'>You have <b><font color='red'>{$ir['treatedweed']}</font></b> treated weed</td> </tr><tr></tr><tr> <td><a href='grow.php?action=grow'>Grow</a></td> <td><a href='grow.php?action=sell'>Sell</a></td> </tr> <tr> <td><a href='grow.php?action=treat'>Treat Weed</a></td> <td><a href='grow.php?action=sellt'>Sell Treated Weed</a></td> </tr> </table> "; } function grow_weed() { global $db,$ir,$userid; echo "It will cost you $10,000 per seed grown.<br /> It will take you 5 Minutes for every 1 seed grown.<br /> How many seeds do you want to grow? <form action='grow.php?action=grow1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Grow' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_weed1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); $cost=($_POST['qty']*10000); $time=($_POST['qty']*5); $quty=($_POST['qty']); if($ir['money'] < $cost) { echo "Your trying to grow more weed than you can afford.<br /><br /><a href='grow.php'>Go Back</a>"; exit; if($_POST['qty'] <= 0) { echo "Your trying to grow no weed!<br /><a href='grow.php'>Go back</a>"; } exit; } else { $db->query("UPDATE users SET money=money-$cost, weed=weed+$quty, weedtime=weedtime+$time WHERE userid=$userid"); echo "You started to grow {$_POST['qty']} ounces costing you $cost.<br /> Your weed will be ready in $time Minutes. <br /><br /><a href='grow.php'>Go back</a>"; } } function grow_sell() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['weed']}</font></b> ounce of Weed.<br /> One ounce will get you $7,500 <form action='grow.php?action=sell1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Sell' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_sell1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*7500); $db->query("UPDATE users SET money=money+$price, weed=weed-{$_POST['qty']} WHERE userid=$userid"); echo "You sold {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } function grow_treat() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['weed']}</font></b> ounce of Weed.<br /> It will cost you $1,000 to treat your weed.<br /> It will take 1 minute for each ounce of weed to complete.<br /> Treating your weed will allow you to see you weed at double its price.<br /> <form action='grow.php?action=treat1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Treat' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_treat1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed to treat<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*1000); $time=($_POST['qty']*1); $db->query("UPDATE users SET money=money-$price, weed=weed-{$_POST['qty']}, treatedweed=treatedweed+{$_POST['qty']}, weedtime=weedtime+$time WHERE userid=$userid"); echo "You treated {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } function grow_sellt() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['treatedweed']}</font></b> ounce of treated Weed.<br /> One ounce will get you $20,000 <form action='grow.php?action=sellt1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Sell' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_sellt1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*20000); $db->query("UPDATE users SET money=money+$price, treatedweed=treatedweed-{$_POST['qty']} WHERE userid=$userid"); echo "You sold {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } $h->endpage(); ?> and then in explore add <a href='grow.php'>Grow Weed</a> The Cron: $db->query("UPDATE `users` SET weedtime=weedtime-1 WHERE `weedtime` > 0"); And your done, if you have any ideas on where i could expand etc please post here.
  9. The problem I noticed with McCodes is it offers no default way to recover passwords. Sure you could have a staff panel and do it manually, but that really doesn't help when an actual user cannot log into their account. So, enter, Password Recovery! This should be pretty fool-proof. It makes the user input a few fields a true owner would only know. (Login name, User ID, registered email) and allows then to specify a password, then confirm a captcha. I believed this to be the best way, since most users will change their name in game at least once, which already makes one of the inputs hard to figure out. The email (in most games) would be hidden from public view, so only the owner (of the game, and account) will know that as well. Involves creating a single file, and editing a file. Righto, lets get started. pwform.php <?php require('globals_nonauth.php'); print <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{$set['game_name']}</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="{$set['jquery_location']}"></script> <script type="text/javascript" src="js/register.js"></script> <link href="css/blue.css" type="text/css" rel="stylesheet" /> <div class='content'> </head> <!-- Begin Main Content --> EOF; ?> <?php if (!isset($_GET['step'])) { $_GET['step'] = ''; } switch ($_GET['step']) { case '1': step1(); break; case '2': step2(); break; default: home(); break; } function home() { die("Wrong URL. Check your source or <a href='?step=1'>Start Here</a>."); } function step1() { $chars = "1234567890"; $len = strlen($chars); $_SESSION['captcha'] = ""; for ($i = 0; $i < 4; $i++) $_SESSION['captcha'] .= $chars[rand(0, $len - 1)]; ?> Input the information correctly and you can reset your account. If you have troubles, please email [email protected]<br /><br /> <form method='post' action='?step=2'> <table> <tr><td>User ID:</td><td> <input type='text' name='userid' placeholder='Enter the account User ID'></td></tr> <tr><td>Login Name:</td><td> <input type='text' name='username' placeholder='Enter login name'></td></tr> <tr><td>Email:</td><td> <input type='text' name='email' placeholder='Enter the account email'></td></tr> <tr><td>New Password:</td><td> <input type='password' name='npw' placeholder='Enter the new password'></td></tr> <tr><td>Confirm Password:</td><td> <input type='password' name='cpw' placeholder='Confirm the password'></td></tr> <tr><td></td><td><img src='captcha_verify.php?bgcolor=C3C3C3' /></td></tr> <tr><td></td><td><input type='text' name='captcha' placeholder='Confirm captcha' /></td></tr> <td></td><td><input type="submit" value='Submit'></td> </table> </form> <?php } function step2() { global $db,$h; $_POST['userid'] = abs((int) $_POST['userid']); $_POST['username'] = (isset($_POST['username']) && preg_match("/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['username']) && ((strlen($_POST['username']) < 32) && (strlen($_POST['username']) >= 3))) ? stripslashes($_POST['username']) : ''; $_POST['email']=(stripslashes($_POST['email'])); $_POST['npw'] = (isset($_POST['npw'])) ? $db->escape(strip_tags(stripslashes($_POST['npw']))) : ''; $_POST['cpw'] = (isset($_POST['cpw'])) ? $db->escape(strip_tags(stripslashes($_POST['cpw']))) : ''; if (!$_SESSION['captcha'] || !isset($_POST['captcha']) || $_SESSION['captcha'] != $_POST['captcha']) { unset($_SESSION['captcha']); die("Captcha Test Failed<br /> > <a href='login.php'>Back</a>"); } unset($_SESSION['captcha']); if (empty($_POST['username'])) { die("You did not specify a username."); } if (empty($_POST['email'])) { die("You did not specify an email."); } if (empty($_POST['npw']) || empty($_POST['cpw'])) { die("You did not specify a password"); } if ($_POST['npw'] != $_POST['cpw']) { die("Passwords do not match."); } if (in_array($_POST['userid'], array(1,122,8))) //Add the User ID's to this array who's password should not be changed { echo 'Invalid user.<br /> > <a href="?action=step1">Go Back</a>'; die($h->endpage()); } $t = $db->query( 'SELECT `user_level` FROM `users` WHERE `userid` = ' . $_POST['userid']); if ($db->num_rows($t) == 0) { $db->free_result($t); die('User ID not found.'); } $u = $db->query( "SELECT `user_level` FROM `users` WHERE `username` = '{$_POST['username']}'"); if ($db->num_rows($u) == 0) { $db->free_result($u); die('Username not found.'); } $e = $db->query( "SELECT `user_level` FROM `users` WHERE `email` = '{$_POST['email']}'"); if ($db->num_rows($e) == 0) { $db->free_result($e); die('Email not found.'); } if (empty($_POST['userid'])) { die("You did not specify a User ID."); } $q=$db->query("SELECT `email`,`userid`,`login_name`,`pass_salt` FROM `users` WHERE `userid` = {$_POST['userid']}"); while ($r=$db->fetch_row($q)) { if ($r['userid'] != ($_POST['userid'])) { die("User ID does not match what you entered."); } if ($r['login_name'] != ($_POST['username'])) { die("Username does not match what you entered."); } if ($r['email'] != ($_POST['email'])) { die("Email does not match what you entered."); } $new_psw = $db->escape(encode_password($_POST['npw'], $r['pass_salt'])); $db->query( "UPDATE `users` SET `userpass` = '{$new_psw}' WHERE `userid` = {$_POST['userid']}"); echo "Password changed!<br />"; } } ?> </body> Save, upload. Open login.php Find: <input type='submit' value='Login'> Paste after: <font size=1> <a href="pwform.php?step=1" onclick="javascript:void window.open('pwform.php?step=1','1428946907530','width=500,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;">Forgot Password?</a></font> Screenie: [ATTACH=CONFIG]1879[/ATTACH] Unintentional game advertising is unintentional. >_> Update: Security flaw fixed.
  10. This is only a basic mod that i made today, But it beats the default one. Update the questions and answers to suit your needs. This is v1 of this mod so i may update it and release new versions here. create a blank page and call it help.php <?php include "globals.php"; $question=strtolower($_POST['question']); echo ' <h2 class="fontface"> <span class="green">T</span>utorial</h2><hr /> <br /><br /> <table border="0" width="650"><tr><td> <p>Welcome to the Tutorial, we hope that this guide will help you to better understand the game.<p><br /> <p>You are free to choose your own path. You can protect the weak, or exploit their weakness. Spend your money to help your friends, or horde it, they can take care of themselves. Buy a gang and become the most respected group of players in the land. Declare war on an enemy, or an innocent bystander, the choice is yours.</p><br /> <h3 class="fontface">'.$set['game_name'].' Help Bot</h3>'; echo '<small>(Ask the Bot a question below and lets see if we can get you going.)</small><br /><br />'; $ask= '<form action="help.php" method="POST">Question: <input type="text" name="question" size="70" placeholder="What would you like to know? why not try typing in training, gangs or rules"><input type="submit" value="Ask"></form>'; if ($question == "") { echo $ask; $h->endpage(); exit; } else { if ($question=="x") { $answerq="x"; } // Replace X with your own if ($question=="help") { $answerq="What do you need help with?"; } if ($question=="hello"||$question=="helo"||$question=="hi"||$question=="hey") { $answerq="Hello how are you?"; } if ($question=="gym"||$question=="the gym") { $answerq="The gym is where you use energy,gold and some will potions to train your stats up.<Br />Stats help you beat up players and protect yourself aswell from attacks."; } if ($question=="good") { $answerq="Im glad to hear your good."; } if ($question=="strength") { $answerq="This stat is used to calculate how much damage a weapon does."; } if ($question=="agility") { $answerq="This stat is used for dodging attacks."; } if ($question=="labour") { $answerq="This stat is used for getting promoted in jobs."; } if ($question=="IQ") { $answerq="This stat is stat is gained from courses and used for promotions."; } if ($question=="gold") { $answerq="Gold are used for various things under <a href=goldtemple.php>Gold Temple</a>"; } if ($question=="cash") { $answerq="Cash is used to buy stuff all over the game"; } if ($question=="energy") { $answerq="This is used mainly for training and attacking"; } if ($question=="brave") { $answerq="This is used for doing crimes"; } if ($question=="health") { $answerq="How much health you have in a fight"; } if ($question=="mine"||$question=="mines") { $answerq="Mining a great way to earn gold"; } if ($question=="job") { $answerq="Nice way to earn cash and stats"; } if ($question=="education") { $answerq="Used for gaining $IQ"; } if ($question=="mail") { $answerq="Your own personal mail system"; } if ($question=="events") { $answerq="What happens to you is recorded here"; } if ($question=="logout") { $answerq="Used to logout of the game, duh."; } if ($question=="explore") { $answerq="Where the main links are listed"; } if ($question=="search") { $answerq="Search for other players!"; } if ($question=="friend list") { $answerq="Record your friends"; } if ($question=="black list") { $answerq="Record your enemys"; } if ($question=="missions") { $answerq="This is where you can use some of your brave to earn some cash."; } if ($question=="preferences") { $answerq="Used to change your account around"; } if ($question=="donate") { $answerq="Donate to the game and be awared donator features"; } if ($question=="vote") { $answerq="Voting earns you rewards and it helps the game grow"; } if ($question=="item"||$question=="items") { $answerq="Items are a main part of the game and used for doing lots of things"; } if ($question=="church") { $answerq="Used for getting married"; } if ($question=="stats") { $answerq="Stats are what determines your account and how good you are"; } if ($question=="travel") { $answerq="Travel around the game"; } if ($question=="casino") { $answerq="Casino, play various games earning you some cash"; } if ($question=="quests") { $answerq="Quests do varios tasks to earn rewards"; } if ($question=="banned") { $answerq="Users banned are listed in dungeon"; } if ($question=="war") { $answerq="War is when 2 gangs's fight each other"; } if ($question=="staff") { $answerq="Main staff can be listed under Staff, ID 1 is the overall owner"; } if ($question=="prison") { $answerq="Sent here when failing crimes"; } if ($question=="hospital"||$question=="hosp") { $answerq="Sent here when attacked"; } if ($question=="noob"||$question=="n00b") { $answerq="Who you calling a noob?"; } if ($question=="fuck"||$question=="shit"||$question=="prick"||$question=="cunt"||$question=="bitch") { $answerq="Please do not swear"; } if ($question=="robot"||$question=="bot") { $answerq="Who you calling a bot!"; } if ($question=="who are you") { $answerq="I am the androidian Bot"; } if ($question=="weather") { $answerq="The weather effects your training at the gym and your mining rates when at the mines.<br />You can also visit the weather page and ask the gods for better weather."; } if ($question=="money") { $answerq="Please Explain? e.g: how to get money or what should i save for"; } if ($question=="how to get money") { $answerq="The best way to get money is by going into the mines and mine for gold and sell it. You could also take a risk and put it into the stock exchange."; } if ($question=="what should i save for") { $answerq="Well thats upto you but personally i would save up for a better house as that will help improove your stats and player."; } if ($question=="users online") { $answerq="This is where you see who is online"; } if ($question=="attacking") { $answerq="Attacking is a good way to get experience, and exert your superiority over those weaker than you. In order to attack you need 1 energy, and should have a weapon. When you win a fight you will get a percentage of experience depending on how much stronger you are compared to the person you are attacking. Make sure that you really want to fight the person, because once you start you can't stop until one of you loses. When you start a fight, you will have the option of using any weapon that you currently have in your items page."; } if ($question=="gangs"||$question=="gangs") { $answerq="Gangs are a group of players that band together to work for a common purpose, granted this may be robbing a bank, or taking down the losers in a rival gang.<br /> Gangs cost $500K to create, and once you buy it, you are the president of your gang.<br /> Your gnag will initially be able to hold 5 members, but will be able to upgrade to more as time goes on.<br /> The President will be able to assign a Vice-President to the gang. Gangs are able to do Organised Crimes for money and respect.<br /> The president can also select to go to war with another gang. One should be careful about doing this though, as it may come back to haunt you."; } if ($question=="training") { $answerq="<b>Gym: </b>To use the gym, type in the number of times you want to train, select the stat to train and click ok.<br /> The next screen will tell you how much of that stat you gained, and what your total in that stat is.<br /><br /> <b>Missions: </b>Go to the mission screen and select the mission you want to do. <br />Remember that trying a mission that is to hard may land you in jail, and lose the experience you've worked so hard to get.<br /><br /> <b>School: </b>School offers courses that will raise your stats over a certain period of time<br /><br /> <b>Your Job: </b>A job will provide you with money at 5:00PM every day, as well as raising your job stats everyday. <br />Some jobs have requirements before you can do them, so make sure to keep an eye out for that.<br /><br /> <b>Attacking: </b>Attacking will gain you experience when you win, but you lose experience if you lose.<br /> The amount of experience depends on the comparative strength of your enemy, if they are much weaker, you won't get much experience."; } if ($question=="rules") { $answerq="Rules are important, They make sure that everyone gets a chance and the games is fair and fun for all. For all the rules please check out the game rules section."; } if ($question=="profile"||$question=="profiles") { $answerq="This is where you can look at yours and other players profiles. Very informative "; } if ($question=="rucksack") { $answerq="this is where you find you items to use within the game, you also find your weapons and armour here.<br />"; } if ($question=="referrals"||$question=="referral") { $answerq="This is where you give friends a link to the game to earn rewards."; } if ($question=="lucky"||$question=="box"||$question=="lucky box") { $answerq="This is your reward for logging in every hour."; } echo $ask.'<br />'; echo '<span class="blue"><b>You asked the Bot:</b></span> '.$question.'<br />'; echo '<span class="gold"><b>The Bot replied:</b></span> '.$answerq; if ($answerq == "") { echo 'Sorry, I dont know the answer. <br />It has been submitted to the database.'; $db->query("INSERT INTO `bot` (`ID` ,`submitted` ,`question` )VALUES (LCASE( NULL ) , '$userid', '$question')"); $h->endpage(); exit; } } echo '</td></tr></table>'; $h->endpage(); ?> Here is the Sql. CREATE TABLE `bot` ( `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `submitted` INT( 11 ) NOT NULL , `question` VARCHAR( 25 ) NOT NULL ) ENGINE = MYISAM ;
  11. I started this a while back for my game but decided not to finish it, But after looking at it, its seems like too much of a waste just to dump it. So feel free to use it, Build on it or whatever. create a file called tamigotcha.php and put this in it. <?php require_once('globals.php'); // Settings // $main = 'Tami-GotchA'; $cost = '1000'; $costcheck = '999'; $foodcost = '10'; $watercost = '10'; $foodgain = '1'; $watergain = '1'; $xpgain = '0.25'; // End Settings // // CONFIGS // $data = $db->query("SELECT * FROM tami WHERE owner=$userid"); $tami = $db->fetch_row($data); $healthperc = (int) ($tami['health'] / $tami['maxhealth'] * 100); $foodperc = (int) ($tami['food'] / $tami['maxfood'] * 100); $waterperc = (int) ($tami['water'] / $tami['maxwater'] * 100); // END CONFIGS echo '<h2 class="fontface">'.$main.'</h2>'; if (!isset($_GET['a'])) { $_GET['a'] = ''; } switch ($_GET['a']) { case 'buy': buy(); break; case 'set': set(); break; case 'doset': doset(); break; case 'eat': eat(); break; case 'drink': drink(); break; default: index(); break; } function index() { global $db,$ir,$h,$userid,$tami,$main,$cost,$healthperc,$foodperc,$waterperc,$foodcost,$watercost,$foodgain,$watergain; if($tami['owner'] == $userid) { $moodc = ($tami['food']+$tami['water']); $moodm = ($tami['maxfood']+$tami['maxwater']); $moodv = ($tami['maxfood']+$tami['maxwater'])/2; $tam['xp_needed'] = (int) (($tami['level'] + 1) * ($tami['level'] + 1) * ($tami['level'] + 1) * 1.2); $xperc = (int) ($tami['xp'] / $tam['xp_needed'] * 100); if ($moodc == $moodm) { $mood='smilies1/biggrin.gif'; $moodt='Happy'; } else { if ($moodc >= $moodv) { $mood='smilies1/mellow.gif'; $moodt='so-so'; } else { if ($moodc <= $moodv) { $mood='smilies1/sad.gif'; $moodt='Sad'; }}} echo '<br /></center> <table border="1" width="95%"> <tr> <td align="center" width="100"><b><u>'.$main.' DETAILS</u></b></td> <td></td> <td></td> </tr> <tr> <td><hr />Name: <span class="blue">'.$tami['name'].'</span><br /> Level: <span class="yellow">'.$tami['level'].'</span> <div style="background: url(images/level-bg.png) no-repeat;width:168px;height:21px;"> <div style="background: url(images/levelx.png) no-repeat;width:'.$xperc.'%;height:21px;"> <div style="width:160px;color: #000;position: absolute;padding-left:10px;line-height:21px;text-shadow:none;"> <font color=black><center><b>XP: '.$tami['xp'].'/'.$tam['xp_needed'].'</b></center></font></div></div></div><hr /> <div class="c100 p'.$healthperc.' dark green"> <span><font color="#5fd400" size="-1">Health: '.$tami['health'].'/'.$tami['maxhealth'].'</font></span> <div class="slice"> <div class="bar"></div> <div class="fill"></div> </div> </div><br /> <div class="c100 p'.$foodperc.' dark orange"> <span><font color="#5fd400" size="-1">Food: '.$tami['food'].'/'.$tami['maxfood'].'</font></span> <div class="slice"> <div class="bar"></div> <div class="fill"></div> </div> </div><br /> <div class="c100 p'.$waterperc.' dark blue"> <span><font color="#5fd400" size="-1">Water: '.$tami['water'].'/'.$tami['maxwater'].'</font></span> <div class="slice"> <div class="bar"></div> <div class="fill"></div> </div> </div></td> <td></td> <td></td> </tr> <tr> <td><b><u>Links</u></b><br /> <table> <tr> <td>Does</td> <td>Cost</td> <td>Gains</td> <td>Actions</td> </tr> <tr> <td>Food</td> <td><span class="green">'.money_formatter($foodcost).'</span></td> <td>+<span class="blue">'.$foodgain.'</span></td> <td><a href="?a=eat"><b>Do</b></a></td> </tr> <tr> <td>Water</td> <td><span class="green">'.money_formatter($watercost).'</span></td> <td>+<span class="blue">'.$watergain.'</span></td> <td><a href="?a=drink"><b>Do</b></a></td> </tr> </table> </td> <td valign="top"> <table border="1" width="50%"> <tr> <td colspan="2" align="center"><b><u>Your '.$main.'\'s Mood</u></b></td> </tr> <tr> <td align="center"><span class="green">'.$moodc.'</span> / <span class="brightred">'.$moodm.'</span></td> <td align="center"><img src="'.$mood.'"><br />'.$moodt.'</td> </tr> </table> </td> <td></td> </tr> </table> '; } else echo '<span class="brightred">No '.$main.'.</span><br /><a href="?a=buy" class="button">Buy one (<small><span class="purple">'.money_formatter($cost).'</span></small>)</a>'; echo '<br /><br /> </center> <hr /> <small> <ul> <li>1. Food and Water goes down by 1 Every hour.</li> <li>2.</li> <li>3.</li> </ul> </small><center> '; } function buy() { global $db,$ir,$h,$userid,$main,$tami, $cost,$costcheck; if($ir['money'] <= $costcheck) { echo 'You dont have enough.<br /><a href="tamigotcha.php" class="button">Back</a>'; $h->endpage(); exit; } else { echo 'You now have a '.$main.'.<br /> <a href="tamigotcha.php?a=set">Set Settings</a>'; $db->query("INSERT INTO `tami`(`owner`) VALUES ($userid)"); $db->query("UPDATE users SET money=money-$cost WHERE userid=$userid"); } } function set() { global $db,$ir,$h,$userid,$tami, $cost,$main; echo ' <form action="?a=doset" method="post"> '.$main.' Name: <input type="text" name="name"> <br /> <input type="submit" value="Set Tami-Gotcha"> </form> '; } function doset() { global $db,$ir,$h,$userid,$tami, $cost,$name; $name = $_POST['name']; $db->query("UPDATE tami SET name='$name' WHERE owner=$userid"); echo 'Done.<br /><a href="tamigotcha.php">Proceed to '.$main.'</a>'; } function eat() { global $db,$ir,$h,$userid,$tami,$foodcost,$foodgain,$main,$xpgain; if($ir['money'] < $foodcost) { echo 'You don\'t have enough<br /><a href="tamigotcha.php" class="button">Back</a>'; $h->endpage(); exit; } else if($tami['food'] >= $tami['maxfood']) { echo 'Your '.$main.' is already full<br /><a href="tamigotcha.php" class="button">Back</a>'; $h->endpage(); exit; } else { $xpgain1 = $xpgain*($tami['level']*$tami['level']); $db->query("UPDATE tami SET food=food+'$foodgain', xp=xp+$xpgain1 WHERE owner=$userid"); $db->query("UPDATE users SET money=money-'$foodcost' WHERE userid=$userid"); echo 'You '.$main.' has gained <span class="green">'.$foodgain.'</span> Food, <span class="gold">'.$xpgain1.'</span> XP which cost you <span class="brightred">'.money_formatter($foodcost).'</span><br /><br /><a href="tamigotcha.php">Proceed to '.$main.'</a>'; } } function drink() { global $db,$ir,$h,$userid,$tami,$watercost,$watergain,$main,$xpgain; if($ir['money'] < $watercost) { echo 'You don\'t have enough<br /><a href="tamigotcha.php" class="button">Back</a>'; $h->endpage(); exit; } else if($tami['water'] >= $tami['maxwater']) { echo 'Your '.$main.' is already full<br /><a href="tamigotcha.php" class="button">Back</a>'; $h->endpage(); exit; } else { $xpgain1 = $xpgain*($tami['level']*$tami['level']); $db->query("UPDATE tami SET water=water+'$watergain', xp=xp+$xpgain1 WHERE owner=$userid"); $db->query("UPDATE users SET money=money-'$watercost' WHERE userid=$userid"); echo 'You Tami-Gotcha has gained <span class="green">'.$watergain.'</span> Food, <span class="gold">'.$xpgain1.'</span> XP which cost you <span class="brightred">'.money_formatter($watercost).'</span><br /><br /><a href="tamigotcha.php">Proceed to '.$main.'</a>'; } } $h->endpage(); ?> Here are the Sqls for the Database. CREATE TABLE `tami` ( `id` int(11) NOT NULL, `owner` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `level` int(11) NOT NULL DEFAULT 1, `xp` decimal(11,2) NOT NULL DEFAULT 0.00, `xp_needed` decimal(11,2) NOT NULL DEFAULT 9.00, `health` int(11) NOT NULL DEFAULT 100, `maxhealth` int(11) NOT NULL DEFAULT 100, `food` int(11) NOT NULL DEFAULT 10, `maxfood` int(11) NOT NULL DEFAULT 10, `water` int(11) NOT NULL DEFAULT 10, `maxwater` int(11) NOT NULL DEFAULT 10 ) ENGINE=MyISAM DEFAULT CHARSET=latin1; These are the crons to place in your cron files. I had mine running hourly. $db->query(sprintf('UPDATE `tami` SET `food` = GREATEST(0, `food` - %u) WHERE `food` > 0', $n3)); $db->query(sprintf('UPDATE `tami` SET `water` = GREATEST(0, `water` - %u) WHERE `water` > 0', $n3)); And thats it, thats as far as i ever got with it. Enjoy.
  12. Here is a Roulette mod that was posted free for GRPG that I converted over to mccodes since I got bored just now. feel free to take it, change it, and critique it just remember all you OGs out there im just a scrub. Original source: http://makewebgames.io/showthread.php/41537-Roulette <?php //Originally coded by grant //Converted by KyleMassacre include_once (DIRNAME(__FILE__) . '/globals.php'); $number = rand(1,36); $n0 = abs(intval($_POST['n0'])); $n1 = abs(intval($_POST['n1'])); $n2 = abs(intval($_POST['n2'])); $n3 = abs(intval($_POST['n3'])); $n4= abs(intval($_POST['n4'])); $n5 = abs(intval($_POST['n5'])); $n6= abs(intval($_POST['n6'])); $n7 = abs(intval($_POST['n7'])); $n8 = abs(intval($_POST['n8'])); $n9 = abs(intval($_POST['n9'])); $n10 =abs(intval( $_POST['n10'])); $n11 = abs(intval($_POST['n11'])); $n12 = abs(intval($_POST['n12'])); $n13 = abs(intval($_POST['n13'])); $n14 = abs(intval($_POST['n14'])); $n15 = abs(intval($_POST['n15'])); $n16= abs(intval($_POST['n16'])); $n17= abs(intval($_POST['n17'])); $n18 = abs(intval($_POST['n18'])); $n19 = abs(intval($_POST['n19'])); $n20= abs(intval($_POST['n20'])); $n21= abs(intval($_POST['n21'])); $n22= abs(intval($_POST['n22'])); $n23 = abs(intval($_POST['n23'])); $n24 = abs(intval($_POST['n24'])); $n25 = abs(intval($_POST['n25'])); $n26 = abs(intval($_POST['n26'])); $n27 = abs(intval($_POST['n27'])); $n28 = abs(intval($_POST['n28'])); $n29= abs(intval($_POST['n29'])); $n30 = abs(intval($_POST['n30'])); $n31= abs(intval($_POST['n31'])); $n32 = abs(intval($_POST['n32'])); $n33 = abs(intval($_POST['n33'])); $n34 = abs(intval($_POST['n34'])); $n35 = abs(intval($_POST['n35'])); $n36 = abs(intval($_POST['n36'])); $e = abs(intval($_POST['e'])); $o = abs(intval($_POST['o'])); $teen = abs(intval($_POST['teen'])); $teen1 = abs(intval($_POST['teen1'])); $black = abs(intval($_POST['black'])); $red = abs(intval($_POST['red'])); $twelve = abs(intval($_POST['twelve'])); $dtv = abs(intval($_POST['dtv'])); $vtz = abs(intval($_POST['vtz'])); $ek = abs(intval($_POST['ek'])); $tk = abs(intval($_POST['tk'])); $dk = abs(intval($_POST['dk'])); if (!empty($_POST['go4'])){ $bet = $n0+$n1+$n2+$n3+$n4+$n5+$n6+$n7+$n8+$n9+$n10+$n11+ $n12+$n13+$n14+$n15+$n16+$n17+$n18+$n19+$n20+$n21+ $n22+$n23+$n24+$n25+$n26+$n27+$n28+$n29+$n30+$n31+ $n32+$n33+$n34+$n35+$n36+$e+$o+$teen+$teen1+$black +$red+$twelve+$dtv+$vtz+$ek+$dk+$tk; $maxbet=50000; $minbet=1000; if ($bet > $ir['money']){ print "You do not have that much money!"; die(); } if ($bet > $maxbet){ print "You cannot bet that much money!"; die(); } if ($bet < $minbet){ print "C'mon cheap skate bet a little more than that!"; die(); } $nmoney = 0; if ($number == 1){ $nmoney = $nmoney + $n1 * 35; $on = 1; }elseif ($number == 2){$nmoney = $nmoney + $n2 * 35; $on = 2; }elseif ($number == 3){$nmoney = $nmoney + $n3 * 35; $on = 3; }elseif ($number == 4){$nmoney = $nmoney + $n4 * 35; $on = 4; }elseif ($number == 5){$nmoney = $nmoney + $n5 * 35; $on = 5; }elseif ($number == 6){$nmoney = $nmoney + $n6 * 35; $on = 6; }elseif ($number == 7){$nmoney = $nmoney + $n7 * 35; $on = 7; }elseif ($number == 8){$nmoney = $nmoney + $n8 * 35; $on = 8; }elseif ($number == 9){$nmoney = $nmoney + $n9 * 35; $on = 9; }elseif ($number == 10){$nmoney = $nmoney + $n10 * 35; $on = 10; }elseif ($number == 11){$nmoney = $nmoney + $n11 * 35; $on = 11; }elseif ($number == 12){$nmoney = $nmoney + $n12 * 35; $on = 12; }elseif ($number == 13){$nmoney = $nmoney + $n13 * 35; $on = 13; }elseif ($number == 14){$nmoney = $nmoney + $n14 * 35; $on = 14; }elseif ($number == 15){$nmoney = $nmoney + $n15 * 35; $on = 15; }elseif ($number == 16){$nmoney = $nmoney + $n16 * 35; $on = 16; }elseif ($number == 17){$nmoney = $nmoney + $n17 * 35; $on = 17; }elseif ($number == 18){$nmoney = $nmoney + $n18 * 35; $on = 18; }elseif ($number == 19){$nmoney = $nmoney + $n19 * 35; $on = 19; }elseif ($number == 20){$nmoney = $nmoney + $n20 * 35; $on = 20; }elseif ($number == 21){$nmoney = $nmoney + $n21 * 35; $on = 21; }elseif ($number == 22){$nmoney = $nmoney + $n22 * 35; $on = 22; }elseif ($number == 23){$nmoney = $nmoney + $n23 * 35; $on = 23; }elseif ($number == 24){$nmoney = $nmoney + $n24 * 35; $on = 24; }elseif ($number == 25){$nmoney = $nmoney + $n25 * 35; $on = 25; }elseif ($number == 26){$nmoney = $nmoney + $n26 * 35; $on = 26; }elseif ($number == 27){$nmoney = $nmoney + $n27 * 35; $on = 27; }elseif ($number == 28){$nmoney = $nmoney + $n28 * 35; $on = 28; }elseif ($number == 29){$nmoney = $nmoney + $n29 * 35; $on = 29; }elseif ($number == 30){$nmoney = $nmoney + $n30 * 35; $on = 30; }elseif ($number == 31){$nmoney = $nmoney + $n31 * 35; $on = 31; }elseif ($number == 32){$nmoney = $nmoney + $n32 * 35; $on = 32; }elseif ($number == 33){$nmoney = $nmoney + $n33 * 35; $on = 33; }elseif ($number == 34){$nmoney = $nmoney + $n34 * 35; $on = 34; }elseif ($number == 35){$nmoney = $nmoney + $n35 * 35; $on = 35; }elseif ($number == 36){$nmoney = $nmoney + $n36 * 35; $on = 36; }else { $nmoney = ""; } // odd or even if($number % 2 == 0) { $type = "even"; } else { $type = "odd"; } if($type == "odd") { $nmoney = $nmoney + $o * 2; } elseif($type == "even") { $nmoney = $nmoney + $e * 2; } //Low or high if ($nummer >= 19) { $nmoney = $nmoney + $high * 2; } elseif($nummer >= 0) { $nmoney = $nmoney + $low * 2; } $red = $_POST['red']; $black = $_POST['black']; $red22 = array ( "1" => "1", "2" => "3", "3" => "5", "4" => "7", "5" => "9", "6" => "12", "7" => "14", "8" => "16", "9" => "18", "10" => "19", "11" => "21", "12" => "23", "13" => "25", "14" => "27", "15" => "30", "16" => "32", "17" => "34", "18" => "36"); $ii = 1; while ($ii < 18){ if ($red22[$ii] == $number){ $colour1 = red; $nmoney = $nmoney + $red * 2; } /////////////////////////////////////////////need to fix coloums!!!! $ii++; } if ($colour1 == ""){ $black1 = array ( "1" => "2", "2" => "4", "3" => "6", "4" => "8", "5" => "10", "6" => "13", "7" => "15", "8" => "17", "9" => "20", "10" => "22", "11" => "24", "12" => "26", "13" => "28", "14" => "29", "15" => "31", "16" => "33", "17" => "35"); $iii = 0; while ($iii < 18){ if ($black1[$iii] == $number){ $colour1 = black; $nmoney = $nmoney + $black * 2; } $iii++; }} //fine $one218 = array ( "0" => "1", "1" => "2", "2" => "3", "3" => "4", "4" => "5", "5" => "6", "6" => "7", "7" => "8", "8" => "9", "9" => "10", "10" => "11", "11" => "12", "12" => "13", "13" => "14", "14" => "15", "15" => "16", "16" => "17", "17" => "18"); $part = 0; while ($part < 17){ if ($one218[$part] == $number){ $nmoney = $nmoney + $teen * 2; } $part++; } $teen236 = array ( "0" => "19", "1" => "20", "2" => "21", "3" => "22", "4" => "23", "5" => "24", "6" => "25", "7" => "26", "8" => "27", "9" => "28", "10" => "29", "11" => "30", "12" => "31", "13" => "32", "14" => "33", "15" => "34", "16" => "35", "17" => "36"); $part1 = 0; while ($part1 < 17){ if ($teen236[$part1] == $number){ $nmoney = $nmoney + $teen1 * 2; } $part1++; } $one212 = array ( "0" => "1", "1" => "2", "2" => "3", "3" => "4", "4" => "5", "5" => "6", "6" => "7", "7" => "8", "8" => "9", "9" => "10", "10" => "11", "11" => "12"); $part2 = 0; while ($part2 < 11){ if ($one212[$part2] == $number){ $nmoney = $nmoney + $twelve * 3; } $part2++; } $teen2244 = array ( "0" => "13", "1" => "14", "2" => "15", "3" => "16", "4" => "17", "5" => "18", "6" => "19", "7" => "20", "8" => "21", "9" => "22", "10" => "23", "11" => "24"); $part3 = 0; while ($part3 < 11){ if ($teen2244[$part3] == $number){ $nmoney = $nmoney + $dtv * 3; } $part3++; } $twen5 = array ( "0" => "25", "1" => "26", "2" => "27", "3" => "28", "4" => "29", "5" => "30", "6" => "31", "7" => "32", "8" => "33", "9" => "34", "10" => "35", "11" => "36"); $part4 = 0; while ($part4 < 11){ if ($twen5[$part4] == $number){ $nmoney = $nmoney + $vtz * 3; } $part4++; } $small = array ( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part5 = 0; while ($part5 < 8){ if ($small[$part5] == $number){ $nmoney = $nmoney + $ek * 3; } $part5++; } $small1 = array ( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part6 = 0; while ($part6 < 8){ if ($small1[$part6] == $number){ $nmoney = $nmoney + $tk * 3; } $part6++; } $small2 = array ( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part7 = 0; while ($part7 < 8){ if ($small2[$part7] == $number){ $nmoney = $nmoney + $dk * 3; } $part7++; } $yougot = $nmoney - $bet; } ?> <table WIDTH="75%" BORDER="0" CELLSPACING="0" CELLPADDING="0" > <tr> <td>Roulette</td> </tr> </table> <form method="post"> <table WIDTH="75%" BORDER="0" CELLSPACING="0" CELLPADDING="0" > <tr> <td WIDTH="0%" HEIGHT="48"> </td> <td WIDTH="0%"> </td> <td WIDTH="0%"> </td> <td WIDTH="0%"> </td> <td WIDTH="31%"> </td> <td COLSPAN="3" ALIGN="center">0 <input name=n0 type=text class="text" ID="n0" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="37"> </td> <td> </td> <td> </td> <td> </td> <td> Max Bet: $50,000<br /> Minimum Bet: $1,000</td> <td WIDTH="23%" ALIGN="center">1 <input name=n1 type=text class="text" ID="n1" size=8 maxlength="10"></td> <td WIDTH="23%" ALIGN="center">2 <input name=n2 type=text class="text" ID="n2" size=8 maxlength="10"></td> <td WIDTH="23%" ALIGN="center">3 <input name=n3 type=text class="text" ID="n3" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="30"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center"><h2>Money $<? echo number_format($ir['money']) ?></h2></td> <td ALIGN="center">4 <input name=n4 type=text class="text" ID="n4" size=8 maxlength="10"></td> <td ALIGN="center">5 <input name=n5 type=text class="text" ID="n5" size=8 maxlength="10"></td> <td ALIGN="center">6 <input name=n6 type=text class="text" ID="n6" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="31"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center"><?php if (!empty($_POST['go4'])){ if ($yougot <= 0){ echo " <h3>Wheel Number ".$number."</h3> <font color='#ff000'>you lost $".number_format($bet)."</font>"; $result = $db->query("UPDATE `users` SET money=money-$bet WHERE `userid`='".$userid."'"); }elseif($yougot > 0){ echo"<h3>Wheel Number ".$number."</h3> <font color='green'>Congratulations you won $".number_format($nmoney)."</font>"; $result = $db->query("UPDATE `users` SET money=money+$nmoney WHERE `userid`='".$userid."'"); }} ?> </td> <td ALIGN="center">7 <input name=n7 type=text class="text" ID="n7" size=8 maxlength="10"></td> <td ALIGN="center">8 <input name=n8 type=text class="text" ID="n8" size=8 maxlength="10"></td> <td ALIGN="center">9 <input name=n9 type=text class="text" ID="n9" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="35"> </td> <td> </td> <td> </td> <td> </td> <td ROWSPAN="12"><img SRC="Roulettetable.png" WIDTH="250" HEIGHT="329"></td> <td ALIGN="center">10 <input name=n10 type=text class="text" ID="n10" size=8 maxlength="10"></td> <td ALIGN="center">11 <input name=n11 type=text class="text" ID="n11" size=8 maxlength="10"></td> <td ALIGN="center">12 <input name=n12 type=text class="text" ID="n12" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="34"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">13 <input name=n13 type=text class="text" ID="n13" size=8 maxlength="10"></td> <td ALIGN="center">14 <input name=n14 type=text class="text" ID="n14" size=8 maxlength="10"></td> <td ALIGN="center">15 <input name=n15 type=text class="text" ID="n15" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="34"> </td> <td COLSPAN="3"> </td> <td ALIGN="center">16 <input name=n16 type=text class="text" ID="n16" size=8 maxlength="10"></td> <td ALIGN="center">17 <input name=n17 type=text class="text" ID="n17" size=8 maxlength="10"></td> <td ALIGN="center">18 <input name=n18 type=text class="text" ID="n18" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="35"> </td> <td COLSPAN="3"> </td> <td ALIGN="center">19 <input name=n19 type=text class="text" ID="n19" size=8 maxlength="10"></td> <td ALIGN="center">20 <input name=n20 type=text class="text" ID="n20" size=8 maxlength="10"></td> <td ALIGN="center">21 <input name=n21 type=text class="text" ID="n21" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="38"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">22 <input name=n22 type=text class="text" ID="n22" size=8 maxlength="10"></td> <td ALIGN="center">23 <input name=n23 type=text class="text" ID="n23" size=8 maxlength="10"></td> <td ALIGN="center">24 <input name=n24 type=text class="text" ID="n24" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="33"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">25 <input name=n25 type=text class="text" ID="n25" size=8 maxlength="10"></td> <td ALIGN="center">26 <input name=n26 type=text class="text" ID="n26" size=8 maxlength="10"></td> <td ALIGN="center">27 <input name=n27 type=text class="text" ID="n27" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="37"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">28 <input name=n28 type=text class="text" ID="n28" size=8 maxlength="10"></td> <td ALIGN="center">29 <input name=n29 type=text class="text" ID="n29" size=8 maxlength="10"></td> <td ALIGN="center">30 <input name=n30 type=text class="text" ID="n30" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="35"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">31 <input name=n31 type=text class="text" ID="n31" size=8 maxlength="10"></td> <td ALIGN="center">32 <input name=n32 type=text class="text" ID="n32" size=8 maxlength="10"></td> <td ALIGN="center">33 <input name=n33 type=text class="text" ID="n33" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="32"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">34 <input name=n34 type=text class="text" ID="n34" size=8 maxlength="10"></td> <td ALIGN="center">35 <input name=n35 type=text class="text" ID="n35" size=8 maxlength="10"></td> <td ALIGN="center">36 <input name=n36 type=text class="text" ID="n36" size=8 maxlength="10"></td> </tr> <tr> <td HEIGHT="40"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">odd <input NAME=o TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">19- 36 <input name=teen type=text class="text" ID="teen" size=8 maxlength="10"></td> <td ALIGN="center">Even <input NAME=e TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> </tr> <tr> <td HEIGHT="53"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">red <input NAME=red TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">1 - 18 <input NAME=teen TYPE=text CLASS="text" ID="teen" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">black <input NAME=black TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> </tr> <tr> <td HEIGHT="58"> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">1 -12 <input NAME=twelve TYPE=text CLASS="text" ID="twelve" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">13 -24 <input NAME=dtv TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">25-36 <input NAME=vtz TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> </tr> <tr> <td HEIGHT="65"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center">1st column <input NAME=ek TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">2nd column <input NAME=tk TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> <td ALIGN="center">3rd column <input NAME=dk TYPE=text CLASS="text" SIZE=8 MAXLENGTH="10"></td> </tr> <tr> <td HEIGHT="37"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td ALIGN="center"><input name='go4' type=submit class="buttong" value=Bet> <input type=reset class="buttong" value=Reset></td> <td> </td> </tr> </table></form> <table WIDTH="75%" BORDER="0" CELLSPACING="0" CELLPADDING="0" > <tr> <td> </td> </tr> </table> <?php ?>
  13. Script Has Been Tested Numerous Times!!! Hello, I have been tweaking this mod for quite some time now. And im proud to release this for mccodes v2. I call this mod Organizations & Productions and this is version 2.0 of the mod. Earlier versions can be found if you search the forums. Although this script has been tested numerous times there still might be a chance an error occurs. Be sure to post it here if something does happen so I may correct it for future reference. In this topic I have a link to the download of the mods zip below. I didnt post the mod on this thread because its far to big. What does this script do? This script allows your users to hire bodyguards, hustlers, bootleggers and whores. They can then get these hired people to do them production/business jobs allowing the user to make some money. What version is this right now and what are the new features? This is currently version 2.0 the version that has been ever so long awaited. After countless pm's/time/PAIN I have finally finished it. Its compatible with mccodes v2 you will probably just have to change colors...etc to suit your game. This version allows you to do everything the old ones did but more. It now has troop stats in which your users must keep up in order to be successful. Also the higher someones troops stats are the more successful they will be. And lots of bugs/errors were fixed and more security added. Be sure to leave credits in the code and not claim my work as yours. If anyone asks who did it, just redirect them to iiistudios.com my indie company site. This thread will be the support thread for the mod so be sure to post your problems here. Also comments on the mod would be most appreciated. Links to Download: http://www.iiistudios.com/orgpmod.rar (this download will only stay up for a few days) http://rapidshare.com/files/175077172/orgp_mod.rar.html more links coming Screenshots: Tutorials: tutorials will be added over time on customizing the content and adding content...
  14. This is my fully automated competition system. It allows you to create competitions for users so they are able to compete with each other for the top 3 prizes. Features Create competition from the control panel - currently crimes and jail busts (names can be edited to suit your game genre). Cancel competition at anytime from the control panel Users can choose to enter a competition Top 10 competitors list Prizes for the top 3 competitors SQL ALTER TABLE `users` ADD `crimes` INT(11) NOT NULL DEFAULT '0' , ADD `jail_busts` INT(11) NOT NULL DEFAULT '0' , ADD `competition` ENUM('0','1') NOT NULL DEFAULT '0' , ADD `competition_starting` INT(11) NOT NULL DEFAULT '0' ; INSERT INTO `settings` (`conf_id`, `conf_name`, `conf_value`) VALUES (NULL, 'competition', 'Inactive'), (NULL, 'competition_type', ''), (NULL, 'competition_prize_1', ''), (NULL, 'competition_prize_2', ''), (NULL, 'competition_prize_3', ''); competition.php <?php /* * Competition System * Free Modification * DidNotCompute - http://makewebgames.io/member.php/70333-DidNotCompute */ include "globals.php"; if ($ir['user_level'] == 2) { echo "<br /><a href='competition_control.php'><u>Click to access Competition Control Panel</u></a>"; } if ($set['competition_type'] == "Crimes") { $type = "crimes"; } elseif ($set['competition_type'] == "Jail Busts") { $type = "jail_busts"; } echo "<h2>Competition</h2>"; if (isset($_POST['enter'])) { if ($set['competition'] == "Inactive") { echo "There are currently no active competitions!"; } else { if ($ir['competition'] == 1) { echo "You are already entered in this competition!"; } else { $db->query("UPDATE users SET competition='1', competition_starting='$ir[$type]' WHERE userid='$userid'"); echo "You have successfully entered the competition!"; }} } $color = $set['competition'] == "Inactive" ? "FF0000" : "32CD32"; echo "<table width='70%' class='table' cellspacing='1'> <tr> <th>Status: <span style='color: #$color'>{$set['competition']}</span></th> </tr> <tr> <td>"; if ($set['competition'] == "Inactive") { echo "<div align='center' style='font-weight: bold;'>There is currently no active competition. Check back soon!</div>"; } else { echo "<div align='center' style='font-weight: bold;'>{$set['competition_type']} Competition</div>"; if ($set['competition_type'] == "Crimes") { echo "<div align='center'>The aim of the competition is to commit as many crimes as possible. The prizes for the top 3 users are:</div>"; } elseif ($set['competition_type'] == "Jail Busts") { echo "<div align='center'>The aim of the competition is to do as many jail busts as possible. The prizes for the top 3 users are:</div>"; } echo "<div align='center'>1. ".(money_formatter($set['competition_prize_1']))."</div>"; echo "<div align='center'>2. ".(money_formatter($set['competition_prize_2']))."</div>"; echo "<div align='center'>3. ".(money_formatter($set['competition_prize_3']))."</div>"; if ($ir['competition'] == 0) { echo "<div align='center'><form method='post'><input type='submit' name='enter' class='button' value='Enter Competition' /></form></div>"; } else { $current = $ir[$type] - $ir['competition_starting']; echo "<div align='center' style='font-weight: bold;'>{$set['competition_type']}: $current</div>"; } } echo "</td> </tr> </table>"; if ($set['competition'] == "Active") { echo "<h3>Top 10</h3>"; echo "<table width='50%' class='table' cellspacing='1'> <tr> <th>#</th> <th>Username</th> <th>{$set['competition_type']}</th> </tr>"; $get_top10 = $db->query("SELECT userid, username, $type, competition_starting FROM users WHERE competition='1' ORDER BY $type-competition_starting DESC LIMIT 10"); $n = 1; while ($top10 = mysql_fetch_object($get_top10)) { $value = $top10->$type - $top10->competition_starting; echo "<tr> <td>$n</td> <td><a href='viewuser.php?u=$top10->userid'>$top10->username</a></td> <td>$value</td> </tr>"; $n++; } echo "</table>"; } $h->endpage(); ?> competition_control.php <?php /* * Competition System * Free Modification * DidNotCompute - http://makewebgames.io/member.php/70333-DidNotCompute */ include "globals.php"; if ($ir['user_level'] != 2) { exit("You do not have permission to view this page"); } if ($set['competition'] == "Active") { echo "<h3>Cancel Competition</h3>"; echo "There is currently a {$set['competition_type']} competition in progress. If you want to cancel this competition then <a href='?cancel=true' style='font-weight: bold;'>click here</a>."; } else { echo "<h3>Create Competition</h3>"; echo "<form method='post'> <div>Type: <select name='type'><option value='Crimes'>Crimes</option><option value='Jail Busts'>Jail Busts</option></select></div> <div>1st Place Prize: <input type='text' name='first_prize' /></div> <div>2nd Place Prize: <input type='text' name='second_prize' /></div> <div>3rd Place Prize: <input type='text' name='third_prize' /></div> <div><input type='submit' name='create_competition' class='button' value='Create Competition' /></div> </form>"; } if (isset($_GET['cancel'])) { $db->query("UPDATE users SET competition='0' WHERE competition='1'"); $db->query("UPDATE settings SET conf_value='Inactive' WHERE conf_name='competition'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_type'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_1'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_2'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_3'"); echo "The competition has been cancelled!"; } if (isset($_POST['create_competition'])) { $type = htmlspecialchars($_POST['type']); $prize1 = abs(intval($_POST['first_prize'])); $prize2 = abs(intval($_POST['second_prize'])); $prize3 = abs(intval($_POST['third_prize'])); $valid_type = array("Crimes", "Jail Busts"); if (!in_array($type, $valid_type)) { echo "The competition type you selected is invalid!"; } else { if (!$prize1 || !$prize2 || !$prize3) { echo "You must fill in all prize fields!"; } else { $db->query("UPDATE settings SET conf_value='Active' WHERE conf_name='competition'"); $db->query("UPDATE settings SET conf_value='$type' WHERE conf_name='competition_type'"); $db->query("UPDATE settings SET conf_value='$prize1' WHERE conf_name='competition_prize_1'"); $db->query("UPDATE settings SET conf_value='$prize2' WHERE conf_name='competition_prize_2'"); $db->query("UPDATE settings SET conf_value='$prize3' WHERE conf_name='competition_prize_3'"); echo "The competition has been successfully created!"; }} } $h->endpage(); ?> competition_cron.php (Set the cron for once a day or once a week, or however long you'd like competitions to last) <?php /* * Competition System * Free Modification * DidNotCompute - http://makewebgames.io/member.php/70333-DidNotCompute */ include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $set = array(); $settq = $db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } if ($set['competition'] == "Active") { if ($set['competition_type'] == "Crimes") { $type = "crimes"; } elseif ($set['competition_type'] == "Jail Busts") { $type = "jail_busts"; } $get_top3 = $db->query("SELECT userid, $type, competition_starting FROM users WHERE competition='1' ORDER BY $type-competition_starting DESC LIMIT 3"); $n = 1; while ($top3 = mysql_fetch_object($get_top3)) { switch ($n) { case 1: $prize = $set['competition_prize_1']; break; case 2: $prize = $set['competition_prize_2']; break; case 3: $prize = $set['competition_prize_3']; break; } $db->query("UPDATE users SET money=money+$prize WHERE userid='$top3->userid'"); $n++; } $db->query("UPDATE users SET competition='0' WHERE competition='1'"); $db->query("UPDATE settings SET conf_value='Inactive' WHERE conf_name='competition'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_type'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_1'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_2'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_3'"); } ?> In docrime.php replace line 31 with mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']}, crimexp=crimexp+{$r['crimeXP']}, crimes=crimes+1 WHERE userid=$userid"); In jailbust.php replace line 28 with $db->query("UPDATE users SET crimexp=crimexp+{$gain}, jail_busts=jail_busts+1 WHERE userid=$userid");
  15. Version 1

    34 downloads

    this back ground i made last year for a game with a bunch of stuff, but thay never paid for my work so here its Need Help?: contact me here or in discord (PHPkiller#5602). Donations?: BTC: 1BxYTrbnunSBG5AmBMyobPkCByWLhAPck4 ETH: 0xD26EE454C3068132dB5ef2E27b86d0C6c138cEc9 DASH: XvUa3A52DywoLgYnTXHTw1goRWyw5T6sRn
    Free
  16. keep getting this error when i add items aslo getting this when i try editing i cant see the error can any one help me?
  17. Having limited time now, and not being able to support or upgrade the following modules any further, I've decided to re-release them as free.   Crafting system was $25.00 Download Farming system was $15.00 Download IP was $5.00 Download Timestamp crons was $5.00 Download Adv. property system was $25.00 Download Username images was $15.00 Download   These systems come as-is, and no support will be given - unless you're really stuck or they don't work. The architecture is pretty non-existent, so please don't judge my current abilities on these ancient systems. Have fun.
  18. My mailbox mod is now free. Updates and fixes will continue.
  19. This Mod was Created by Illusions and HAUNTED DAWG in 2009. I have since updated it and made it look nicer and made sure it works with the latest version of mccodes. Place this into your phomyadmin INSERT INTO `settings` (`conf_id`, `conf_name`, `conf_value`) VALUES ('18', 'editpage', 'explore.php'); Add these links to smenu.php <a href='fileeditor.php?action=startfile'>Create PHP Page</a> <a href='fileeditor.php?action=edit'>Edit PHP Page</a> Create php file and name it fileeditor.php and dump this into it. <style type="text/css" media="screen"> .button { background-color: #4CAF50; border-radius: 10px; border: none; color: white; padding: 8px 25px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 2px 1px; cursor: pointer; } input[type='text'] { width: 221px; color : #423232; height:25px; border:1; padding:4px 8px; margin-bottom:0px; border-radius: 10px; } textarea[name='filetext'] { width: 500px; color : #423232; height: 250px; border:1; padding:4px 8px; margin-bottom:0px; border-radius: 10px; } body { background-color: #cdcdcd; } </style> <?php // CREATED FOR MCCODES V2 BY ILLUSIONS AND HAUNTED DAWG 2009 // // AS I USUALLY DONT CARE ABOUT NOTICES STAYING INTACT I WOULD LIKE THIS ONE TO STAY IS ITS A JOINT EFFORT THANKS ALL // // Updated by PeterisGB 2020 // require "sglobals.php"; switch($_GET['action']) { case "startfile": startfile(); break; case "startprocess": startprocess(); break; case 'edit': editpage(); break; default: echo 'Error: This script requires an action.'; break; } function startfile() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { echo 'ACCESS DENIED'; $h->endpage(); exit; } echo '<br /><br /><h2>Create File</h2> Always make a backup of any copy before using this system.<br /> <hr /> The file name and Data you create on here will also be Created on your FTP.<br /> You can use any file Format for EXAMPLE test.php, test.html, test.css.<br /> You can overwrite a file simply by giving it the same file name.[i] <hr/ > <form action="fileeditor.php?action=startprocess" method="_POST"> Create File Name: <input type="text" name="name" placeholder="example: explore.php"> <hr>Copy and Paste Data Below or Create New Data<hr> <textarea name="filetext" placeholder="Place PHP script HERE"></textarea><br /> <input type="submit" value="Create New File" class="button"></form> <hr> '; } { $h->endpage(); exit; } // We use isset so we dont get the undefined index blah blah errors // We check if they have hit the submit button function startprocess() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die('ACCESS DENIED'); $h->endpage(); exit; } $name = $_POST['name']; if( isset($_POST['name']) ) { //We open the name as w since w stands as wright. <a href="http://www.php.net/fopen" target="_blank">http://www.php.net/fopen</a> is a good tutorial chmod($name, 0755); $fo = fopen($filetext."$name", "w"); fwrite($fo, $pick); //Since we stripped the </textarea> to <+textarea+> we need to convert back to </textarea> //Since this is editing a name, we can not really put in any security only that ID 1 can edit it // GET FILE VIEW FOR FTP TRANSFER $conv = stripslashes(($_POST['filetext'])); if(fwrite($fo, $conv)) { echo '<h2>If you see an error message above regards CHMOD just ignore it.<br /> It just means that the file never exsisted in the first place once its on your FTP the error message will not be displayed.</h2> <font color="green"> <h1>File Name</h1></font> <font color="red"><h1>'.$name.'</font></h1> <font color="green"><h1> Created and Saved to FTP</h1></font> <font color="green"><h1> File is now Available for Use in Game</h1></font>'; } else { echo '<font color="red"><h1>File '.$name.' Could not be Written Please Try Again</h1></font>'; } fclose($fo); } else { //Bellow we fetch name contents using name_get_contents. <a href='www.php.net/name_get_contents'>http://www.php.net/name_get_contents</a> is a good tutorial $tup = file_get_contents($name); //Since if the name has </textarea> in it, it will screw up this code. Convert it out to <+textarea+> $tup = stripslashes(($_POST['filetext'])); //Bellow you should understand what it does. echo '<form action="'.$_SERVER['PHP_SELF'].'?action=startfile" method="post"> <iframe width=100% height=500 frameborder=0 scrolling="yes" src="'.$name.'"></iframe> <input type="submit" value="Create Another File"> </form>'; } } function editpage() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); $h->endpage(); exit; } if($_POST['submit']) { unset($_POST['submit']); foreach($_POST as $k => $v) { $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'"); } echo '<br /><br /><br /><br />Page Loaded.<br /><br /> <a href="filedata.php"><h2>Continue</h2></a>'; stafflog_add("Editing Page {$_POST['editpage']}"); } else { $page = $set['editpage']; echo " <h3>Edit Page</h3><hr /> <form action='filedata.php?action=edit' method='POST'> <input type='hidden' name='submit' value='1'> Edit Page Url: <input type='text' name='editpage' value='$page'><br /> E.g = explore.php<br /> <input type='submit' value='Edit' class='button'></form>"; } } ?> and create a php file called filedata.php and dump this. <style type="text/css" media="screen"> .button { background-color: #4CAF50; border-radius: 10px; border: none; color: white; padding: 8px 25px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 2px 1px; cursor: pointer; } input[type='text'] { width: 221px; color : #423232; height:25px; border:1; padding:4px 8px; margin-bottom:0px; border-radius: 10px; } textarea[name='filetext'] { width: 500px; color : #423232; height: 250px; border:1; padding:4px 8px; margin-bottom:0px; border-radius: 10px; } body { background-color: #cdcdcd; } </style> <?php // CREATED FOR MCCODES V2 BY ILLUSIONS AND HAUNTED DAWG 2009 // // AS I USUALLY DONT CARE ABOUT NOTICES STAYING INTACT I WOULD LIKE THIS ONE TO STAY IS ITS A JOINT EFFORT THANKS ALL // // Updated by PeterisGB 2020 // require "sglobals.php"; global $db,$ir,$r,$set; if($ir['user_level'] != 2) { die('ACCESS DENIED'); $h->endpage(); exit; } $file = ''.$set['editpage'].''; //changing this name will also change the REAL VIEW MODE to the correct file // THE CONTENTS OF $file CAN BE OF ANY METHOD EXAMPLE HTML, CSS, PHP, ASX /////////////////////////////////////////////////////////////////////////////////////////////////////// // REMEMBER YOU CAN ALSO AMEND THIS FILE TO ALTER THE NAME OF THE $FILE NAME YOUR EDITING /// ////////////////////////////////////////////////////////////////////////////////////////////////////// //We use isset so we dont get the undefined index blah blah errors //We check if they have hit the submit button if( isset($_POST['file']) ) { //We open the file as w since w stands as write. <a href='www.php.net/fopen'>http://www.php.net/fopen</a> is a good tutorial chmod($file, 0755); $fo = fopen($file, 'w'); //Since we stripped the <+textarea+> to <+textarea+> we need to convert back to <+textarea+> //Since this is editing a file, we can not really put in any security only that ID 1 can edit it // I USED STRIPSLASHES INSTEAD OF PREG_REPLACE COS IT ****ED THINGS UP $conv = stripslashes($_POST['file']); if(fwrite($fo, $conv)) { echo '<font color="green"><h1>File Ammended And Saved</h1></font> <h1>New file view Below Check for errors if any</h1> <table width="100%" border="10" cellpadding="4" cellspacing="0"><td> <textarea name="file" cols="150" rows="15">'.$conv.'<+textarea+></td></table> <body bgcolor="#000000"> <a href="fileeditor.php?action=startfile" class="button">[>>> Create New File <<<]</a> <a href="filedata.php" class"button">[>>> RETURN TO EDIT '.$file.' <<<]</a> <hr><h1>REAL VIEW OF AMMENDED FILE BELOW</h1> <iframe width=100% height=500 frameborder=0 scrolling="yes" src="'.$file.'"></iframe> </body> </html>'; } else { echo '<font color="red">Could not save file.</font>'; } fclose($fo); } else { //Below we fetch file contents using name_get_contents. <a href='www.php.net/name_get_contents'>http://www.php.net/name_get_contents</a> is a good tutorial //FOOTNOTE i changed name_get to file_get as the textarea wasnt working right and kept adding back slashes to the script. //so i suppose php.net dont know everything he he he he $tup = file_get_contents($file); //Since if the file has <+textarea+> in it, it will screw up this code. Convert it out to <+textarea+> $tup = preg_replace('~<+textarea+>~is','<textarea>',$tup); //Bellow you should understand what it does. echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"> <h1>Editing File '.$file.'</h1> <table width="100%" border="10" cellpadding="4" cellspacing="0"><td> <textarea name="file" cols="150" rows="15">'.$tup.'</textarea></td></table> <input type="submit" value="Save And Ammend File" class="button"><br /> <a href="filededitor.php?action=startfile" class="button">[>>> GOTO FILE CREATOR <<<]</a><br /> <a href="filedata.php" class="button">[>>> REFRESH CURRENT PAGE DATA <<<]</a><br /> <hr><h1>UNEDITED FILE BELOW REAL VIEW</h1> <iframe width=100% height=500 frameborder=0 scrolling="yes" src="'.$file.'"></iframe> <input type="submit" value="Save And Ammend File" class="button"> </form>'; } $h->endpage(); ?> Screenshots below.
  20. Hi all, I recently came across this site as I fell back into text based games, and i have decided to try run my own again (previous attempt was a number of years ago and life got in the way). I have reached out to a couple of people but it doesn't seem like anyone still wants to work with MCCodes (I completely understand why) but i am hoping to use this purely because i am used to it (at least the db and the staff panel) and for nostalgia ! Currently, i have a domain and a working site, with around 3 mods, and a plan for the game itself. I am looking for a dev to help me with some mods, layout/theme and general tips / experience and am willing to pay. I am fully expecting everyone to tell me to stop being daft and get on GL but i thought it would be worth a crack. Any suggestions / advice would be greatly appreciated Chris
  21. not sure if this is the right spot or not so i am sorry in advance if its not. but is there a mod for or a way to completely ban an ip address?
  22. do people still need mods and is V2 still alive for the use of mods ?
  23. An add-on for that mining mod I put together. They both can be used together, and I would highly recommend that they are. CREATE A FILE CALLED refine.php: <?php /** Mod Title: Refinery Info: Refine Gold/Silver/Copper flakes into their respected currency. By: TheMasterGeneral Code Tweaks: KyleMassacre (Thanks Kyle!) Cost: Free File: /refine.php */ require('refine_globals.php'); if (!isset($_GET['action'])) { $_GET['action'] = ''; } switch ($_GET['action']) { case 'refinegold': refine_gold(); break; case 'refinesilver': refine_silver(); break; case 'refinecopper': refine_copper(); break; default: refine_home(); break; } function refine_home() { global $h; echo "<h3>Refinery</h3> Welcome to the refinery. Here you may refine your flakes into coins! How awesome is that?! You've got to have the flakes, and the skill. If you have neither, you will more than likely fail at refining flakes. Now, what would you like to refine? [<a href='refine.php?action=refinecopper'>Copper Coins</a>] [<a href='refine.php?action=refinesilver'>Silver Coins</a>] [<a href='refine.php?action=refinegold'>Gold Coins</a>]"; //Gold coins is my third currency. If you //Do not have, then you can remove the link. $h->endpage(); } function refine_copper() { global $db,$userid, $h, $refine; $q = $db->query("SELECT (`inv_qty`) FROM `inventory` WHERE `inv_itemid` = {$refine['itemidcopperflake']} AND `inv_userid` = $userid"); $totalcflakes = $db->fetch_single($q); $db->free_result($q); echo "<h3>Refine Copper</h3>"; if(!isset($_POST['amount'])) { print "<form action='refine.php?action=refinecopper' method='post'> How many flakes do you wish to refine into copper coins? If you enter a value higher than the amount of flakes needed, you will lose those flakes. (If you have 11 flakes, and enter 11 flakes, you will receive 1 coin, and lose all flakes) <input type='text' name='amount' /> <input type='submit' value='Refine Copper Flakes' /> </form>"; } else { //Sanitize input $_POST['amount'] = abs((int) $_POST['amount']); if (!$_POST['amount']) { echo "Invalid use of file"; exit; } //Zero input? if ($_POST['amount'] < $refine['requirecflakes']) { echo "You need to refine at least {$refine['requirecflakes']} flakes to get a coin."; $h->endpage(); exit; } //Input larger than inventory amount? if ($_POST['amount'] > $totalcflakes) { echo "You do not have that many flakes to refine."; $h->endpage(); exit; } //Refine complete. $receivedcflakes = ($_POST['amount']/$refine['requirecflakes']); $flakesgonec = ($receivedcflakes*$refine['requirecflakes']); echo "You have refined {$_POST['amount']} Copper Flakes and gained {$receivedcflakes} Copper Coins!"; item_remove($userid, $refine['itemidcopperflake'], $flakesgonec); $db->query( "UPDATE `users` SET `money` = `money` + {$receivedcflakes} WHERE `userid` = {$userid}"); $h->endpage(); exit; } } function refine_silver() { global $db, $userid, $h, $refine; $q = $db->query("SELECT (`inv_qty`) FROM `inventory` WHERE `inv_itemid` = {$refine['itemidsilverflake']} AND `inv_userid` = $userid"); $totalsflakes = $db->fetch_single($q); $db->free_result($q); echo "<h3>Refine Silver</h3>"; if(!isset($_POST['amount'])) { print "<form action='refine.php?action=refinesilver' method='post'> How many flakes do you wish to refine into Silver Coins? If you enter a value higher than the amount of flakes needed, you will lose those flakes. (If you have 26 flakes, and enter 26 flakes, you will receive 1 coin, and lose all flakes) <input type='text' name='amount' /> <input type='submit' value='Refine Silver Flakes' /> </form>"; } else { //Sanitize input $_POST['amount'] = abs((int) $_POST['amount']); if (!$_POST['amount']) { echo "Invalid use of file"; exit; } //Zero input? if ($_POST['amount'] < $refine['requiresflakes']) { echo "You need to refine at least {$refine['requiresflakes']} flakes to get a coin."; $h->endpage(); exit; } //Input larger than inventory amount? if ($_POST['amount'] > $totalsflakes) { echo "You do not have that many flakes to refine."; $h->endpage(); exit; } //Refine complete. $receivedsflakes = ($_POST['amount']/$refine['requiresflakes']); $flakesgones = ($receivedsflakes*$refine['requiresflakes']); echo "You have refined {$_POST['amount']} Silver Flakes and gained {$receivedsflakes} Silver Coins!"; item_remove($userid, $refine['itemidsilverflake'], $flakesgones); $db->query( "UPDATE `users` SET `crystals` = `crystals` + {$receivedsflakes} WHERE `userid` = {$userid}"); $h->endpage(); exit; } } function refine_gold() { global $db, $userid, $h, $refine; $q = $db->query("SELECT (`inv_qty`) FROM `inventory` WHERE `inv_itemid` = {$refine['itemidgoldflake']} AND `inv_userid` = $userid"); $totalgflakes = $db->fetch_single($q); $db->free_result($q); echo "<h3>Refine Gold</h3>"; if(!isset($_POST['amount'])) { print "<form action='refine.php?action=refinegold' method='post'> How many flakes do you wish to refine into gold coins? If you enter a value higher than the amount of flakes needed, you will lose those flakes. (If you have 51 flakes, and enter 51 flakes, you will receive 1 coin, and lose all flakes) <input type='text' name='amount' /> <input type='submit' value='Refine Gold Flakes' /> </form>"; } else { //Sanitize input $_POST['amount'] = abs((int) $_POST['amount']); if (!$_POST['amount']) { echo "Invalid use of file"; exit; } //Zero input? if ($_POST['amount'] < $refine['requiregflakes']) { echo "You need to refine at least {$refine['requiregflakes']} flakes to get a coin."; $h->endpage(); exit; } //Input larger than inventory amount? if ($_POST['amount'] > $totalgflakes) { echo "You do not have that many flakes to refine."; $h->endpage(); exit; } //Refine complete. $receivedgflakes = ($_POST['amount']/$refine['requiregflakes']); $flakesgoneg = ($receivedgflakes*$refine['requiregflakes']); echo "You have refined {$_POST['amount']} Gold Flakes and gained {$receivedgflakes} Gold Coins!"; item_remove($userid, $refine['itemidgoldflake'], $flakesgoneg); $db->query( "UPDATE `users` SET `goldcoin` = `goldcoin` + {$receivedgflakes} WHERE `userid` = {$userid}"); $h->endpage(); exit; } } Save, upload. CREATE ANOTHER FILE CALLED refine_globals.php: [There's an underscore (_) between refine and globals] <?php //Thanks Kyle require_once('globals.php'); //Config start. (Edit as you see fit) $refine = array( "requiregflakes" => 50, "requiresflakes" => 25, "requirecflakes" => 10, "itemidgoldflake" => 94, "itemidsilverflake" => 68, "itemidcopperflake" => 95 ); //Config end Replace the information I have set to yours. You may have to consult your mine_globals.php file for your items (if you are currently using the mining mod I made) Save, upload. ADD TO explore.php (or anywhere): <a href='refine.php'>Refinery</a> Screenies: Home Refine? Refined! Current Version: 1.0 Changelog Version 1.0 [1-15-2015]: Public release "Friendly to lazies" download link coming in a few!! Comments, questions or concerns. please let me know by replying here or by PM.
  24. This mod was created a while back, but I wasn't able to upload it as I lost all my coding things when my laptop got messed up. However I did find a backup, so here it is. It is a back for Crystals or whatever you're game has named them, hence the name secondary bank. All feedback welcome. :) seBank.php <?php include 'globals.php'; /* Designed and developed by Script47. Edited by Peterisgb & Re-recoded by Magictallguy. The code here (named "seBank") is provided "as is" with no warranty or gurantee of safety to existing code. seBank has been fully tested and is found to work as intended. seBank is released freely under the GNU License. Feel free to modify as you wish, as long as this comment block remains untouched. */ $bankprice = 10000; $currencyname = $set['crystalname']; // Change to set your crystal's name. echo "<h3>",$currencyname," Bank</h3>"; if($ir['bankcrystals'] > -1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 9999) { $db->query("UPDATE `users` SET `money` = `money` - ".$bankprice.", `bankcrystals` = 0 WHERE `userid` = ".$userid); ?>Congratulations, you bought a <? echo $currencyname; ?> bank for <? echo money_formatter($bankprice); ?>!<br /><a href="sebank.php">Start using your account</a><br /><? } else { ?>Sorry, you don't have enough <? echo $set['moneyname']; ?> to open a account.<br /><a href='explore.php'>Back to town?</a><br /><? } } else { ?>Open a bank account today, just <? echo money_formatter($bankprice); ?>!<br /><a href='sebank.php?buy'>> Yes, sign me up!</a><? } } function index() { global $ir, $currencyname; ?><strong>You currently have <? echo number_format($ir['bankcrystals']).' '.$currencyname; ?> in the bank.</strong><br /> <table width='75%' cellspacing='1' class='table'> <tr> <td width='50%'><strong>Deposit <? echo $currencyname; ?></strong><br /> <form action='sebank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='<? echo number_format($ir['crystals']); ?>' /><br /> <input type='submit' value='Deposit' /> </form></td> <td><strong>Withdraw <? echo $currencyname; ?></strong><br /> <form action='sebank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='<? echo number_format($ir['bankcrystals']); ?>' /><br /> <input type='submit' value='Withdraw' /> </form></td> </tr> </table><? } function deposit() { global $db, $ir, $h, $currencyname; $_POST['deposit'] = isset($_POST['deposit']) && is_string($_POST['deposit']) ? abs(@intval(str_replace(',', '', $_POST['deposit']))) : null; if(empty($_POST['deposit'])) { echo "You didn't enter a valid amount to deposit"; $h->endpage(); exit; } if($_POST['deposit'] > $ir['crystals']) { echo "You do not have enough ",$currencyname," to deposit this amount."; $h->endpage(); exit; } $db->query("UPDATE `users` SET `bankcrystals` = `bankcrystals` + ".$_POST['deposit'].", `crystals` = `crystals` - ".$_POST['deposit']." WHERE `userid` = ".$ir['userid']); echo "You hand over ",number_format($_POST['deposit'])," ",$currencyname," to be deposited. <br /><a href='sebank.php'>> Back</a>"; } function withdraw() { global $db, $ir, $h, $currencyname; $_POST['withdraw'] = isset($_POST['withdraw']) && is_string($_POST['withdraw']) ? abs(@intval(str_replace(',', '', $_POST['withdraw']))) : null; if(empty($_POST['withdraw'])) { echo "You didn't enter a valid amount to withdraw"; $h->endpage(); exit; } if($_POST['withdraw'] > $ir['bankcrystals']) { echo "You do not have enough ",$currencyname," in the bank to withdraw this amount."; $h->endpage(); exit; } $db->query("UPDATE `users` SET `bankcrystals` = `bankcrystals` - ".$_POST['withdraw'].", `crystals` = `crystals` + ".$_POST['withdraw']." WHERE `userid` = ".$ir['userid']); echo "You ask to withdraw ",number_format($_POST['withdraw']),", <br />the banker hands it over. <br /><strong>You now have ",number_format($ir['bankcrystals'] - $_POST['withdraw'])," ",$currencyname," in the bank.</strong><br /><a href='sebank.php'>> Back</a>"; } $h->endpage(); ?> SQL: ALTER TABLE users ADD COLUMN bankcrystals INT NOT NULL DEFAULT '-1';
  25. I pretty sure the mccodes engine is dead now but would there be any updates on the ip system for support with ipv6 connections. I dont have ipv4 which some sites (mccodes included) require to run perfectly.
×
×
  • Create New...