
War_Hero
Members-
Posts
232 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by War_Hero
-
Re: [FREE] [V2] Ian's Investments Lol. Why not? :lol: It's just a name that popped into my head. It's alliteration. It'll attract the user's attention....supposedly, according to poetry. :lol: :-D
-
Re: [FREE] [V2] Ian's Investments Thanks. :) Change this in the level_upgrade() function: $upgrade = ($ir['level'] * 3000); Change the 3000 to whatever you like. Make sure to change it in the levelupgrade_sub() function as well. Then change this in the level_upgrade2() function: $upgrade2 = ($ir['level'] * 5500); Change the 5500 to whatever you like. Make sure to change it in the levelupgrade2_sub() function as well. :)
-
Hi all. I made this mod a while back but didn't post it. But I've decided to post on here to see what you all think. I made this mod when I was first learning PHP (I still am learning, but have improved since I made this). :) Really, this is more of a Super Bank than an investment. ;) What it does: This 'investment' mod will allow the users to invest their money for a certain amount of time: 7 days, 14 days or 31 days. But, to invest some money, they have to sign a contract with the company. The contract lasts 60 days, but can be changed. Once a contract has been signed, the user can invest some money. At first, the user is at Level 0. They can upgrade to Level 1 if they want and receive more interest than at Level 0. Once at Level 1, they can then upgrade to Level 2 and receive even more interest per day. Once the 'investment' has been started, they can't cancel it or retrieve their money. They will have to wait until it finishes. Now for installation: Step 1: Run this SQL: ALTER TABLE `users` ADD `userCONTRACT` INT(11) NOT NULL DEFAULT '0', ADD `userDAYS` INT(11) NOT NULL DEFAULT '0', ADD `userBANKAMMT` INT(11) NOT NULL DEFAULT '0', ADD `investlevel` INT(11) NOT NULL DEFAULT '0'; Step 2: Create a file called investment.php and put this in it: <?php include "globals.php"; if($ir['level'] < 30) { echo "You have to be level 30 or over to access this feature. Sorry."; $h->endpage(); exit; } echo "<h4><u>:: Ian's Investment Program ::</u></h4>"; switch($_GET['action']) { case 'investhome': invest_home(); break; case 'buyinvest': buy_invest(); break; case 'buyinvestsub': buyinvest_sub(); break; case 'invest': invest(); break; case 'getinvest': get_invest(); break; case 'levelupgrade': level_upgrade(); break; case 'levelupgradesub': levelupgrade_sub(); break; case 'levelupgrade2': level_upgrade2(); break; case 'levelupgrade2sub': levelupgrade2_sub(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; print "<h2 />Welcome to Ian's Investment Program. How may we help you? <form action = 'investment.php?action=buyinvest' method = 'post' /> <input type = 'submit' value = 'Get Contract' name = 'buyinvest' /> </form> "; if($ir['userBANKAMMT'] > 0) { echo " <form action = 'investment.php?action=investhome' method = 'post' /> <input type = 'submit' value = 'View Investment' name = 'investhome' /> </form> "; } else { echo " <form action = 'investment.php?action=investhome' method = 'post' /> <input type = 'submit' value = 'Start Investment' name = 'investhome' /> </form> "; } if($ir['investlevel'] == 0) { echo " <form action = 'investment.php?action=levelupgrade' method = 'post' /> <input type = 'submit' value = 'Upgrade to Level 1' name = 'upgradelevel' /> </form>"; } elseif($ir['investlevel'] == 1) { echo " <form action = 'investment.php?action=levelupgrade2' method = 'post' /> <input type = 'submit' value = 'Upgrade to Level 2' name = 'upgradelevel2' /> </form>"; } else { echo " "; } } function buy_invest() { global $db,$ir,$c,$h,$userid; $contract = ($ir['level'] * 200); if($ir['userCONTRACT'] > 0) { die ("You already have a contract with us. Your contract will last for {$ir['userCONTRACT']} more days. <a href = 'investment.php' />Go Back</a>"); } else { print "Welcome. Would you like to sign a contract with us for \$$t".money_formatter($contract,'')."? <form action = 'investment.php?action=buyinvestsub' method = 'post' /> <input type = 'submit' value = 'Yes' /> </form> <form action = 'investment.php' method = 'post' /> <input type = 'submit' value = 'No' /> </form>"; } } function buyinvest_sub() { global $db,$ir,$c,$h,$userid; $contract = ($ir['level'] * 200); if($ir['money'] < $contract) { die("You don't have enough money to sign a contract. You need \$$t".money_formatter($contract,'')."."); } elseif($ir['userCONTRACT'] > 0) { die("You already have a contract with us. Your current contract still has {$ir['userCONTRACT']} days on it."); } else { print "Congratulations. You have signed a contract with us for 60 days. After the 60 days, you will have to sign another contract to start an investment. <a href = 'investment.php' />Go Back</a>"; $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d', `userCONTRACT` = '%d' WHERE `userid` = ('%u')", $contract, 60, $userid)); } } function invest_home() { global $db,$ir,$c,$h,$userid; if($ir['userCONTRACT'] == 0) { die("You need to sign a contract first. To sign a contract, <a href = 'investment.php?action=buyinvest' />GO HERE</a>."); } elseif($ir['userDAYS'] != 0) { print "You currently have £$t".money_formatter($ir['userBANKAMMT'],'')." invested in our bank. That money will become available in {$ir['userDAYS']} days. You will gain <font color = 'yellow' />3.0% interest per day if you're at Level 0</font>, <font color = 'purple' />5.5% interest per day if you're at Level 1</font> and <font color = '#F6358A' />7.2% interest per day if you're at Level 2.</font> <center /><b />You're at Level {$ir['investlevel']}[/b].</center> <a href = 'index.php' />Go Home</a>"; } elseif($ir['userdays'] == 0 && $ir['userBANKAMMT'] ) { echo "Your investment has been completed. Please collect your £$t".money_formatter($ir['userBANKAMMT'],'').". <form action = 'investment.php?action=getinvest' method = 'post' /> <input type = 'submit' value = 'Get £$t".money_formatter($ir['userBANKAMMT'],'')."' name = 'getinvest' /> </form>"; } elseif($ir['userBANKAMMT'] == 0) { echo "<table width='55%' border='2' class='table'><tr><td width='50%'> <h4><font color=yellow>[b]<u>Invest Money With Ian's Investment Program[/b]</u></font></h4> You can invest your money with Ian. Once you invest your money it is kept here and you cannot touch it until the investment is finished. You can upgrade to Level 1, which gives 5.5% interest each day, by clicking <a href = 'investment.php?action=levelupgrade' />HERE</a>. Or, you can upgrade to Level 2, which gives 7.2% interest each day, by clicking <a href = 'investment.php?action=levelupgrade2' />HERE</a>. Please select how much you wish to invest and for how long you wish to invest for. <form action='investment.php?action=invest' method='post'> Amount to Invest: <input type='text' name='invest' value='{$ir['userBANKAMMT']}' /> Length of Investment: <select name='timetoinvest' type='dropdown'> <option value='1'>7 Days</option> <option value='2'>14 Days</option> <option value='3'>31 Days</option></select> <center> <input type='submit' value='Start Investment' /></center></form></td> </tr> </table>"; } } function invest() { global $db,$ir,$c,$userid,$h; $_POST['invest']=abs((int) $_POST['invest']); if($_POST['invest'] > $ir['money']) { die ("You do not have enough money to invest this ammount. <a href = 'bank.php' />Go Here</a> to get some more money."); } elseif($_POST['invest'] < 1) { die("You have to enter a number greater than zero! <a href = 'bank.php' />Get some money</a>."); } else { if($_POST['timetoinvest'] == 1) { $gain=$_POST['invest']; $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d', `userBANKAMMT` = '%d', `userDAYS` = '%d' WHERE `userid` = ('%u')", $_POST['invest'], $gain, 7, $userid)); if($ir['investlevel'] == 0) { echo "Thank you for your investment of £$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 3.0% interest each day. After 7 days, you can collect your money. [url='index.php']> Thank You[/url] [url='explore.php']> Back To The City...[/url]"; } elseif($ir['investlevel'] == 1) { echo "Thank you for your investment of £$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 5.5% interest each day. After 7 days, you can collect your money. <a href = 'index.php' />> Thank you</a> <a href = 'explore.php' />> Back To The City...</a>"; } elseif($ir['investlevel'] == 2) { echo "Thank you for your investment of \$$t".money_formatter($_POST['invest'],'').". At Level 2, you will gain 7.2% interest each day. After 7 days, you can collect your money. <a href = 'index.php' />> Thank you</a> <br /. <a href = 'explore.php' />> Back To The City...</a>"; } } else if($_POST['timetoinvest'] == 2) { $gain=$_POST['invest']; $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d', `userBANKAMMT` = '%d', `userDAYS` = '%d' WHERE `userid` = ('%u')", $_POST['invest'], $gain, 14, $userid)); if($ir['investlevel'] == 0) { echo "Thank you for your investment of £$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 3.0% interest each day. After 14 days, you can collect your money. [url='index.php']> Thank You[/url] [url='explore.php']> Back To The City...[/url]"; } elseif($ir['investlevel'] == 1) { echo "Thank you for your investment of £$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 5.5% interest each day. After 14 days, you can collect your money. <a href = 'index.php' />> Thank You</a> <a href = 'explore.php' />> Back To The City...</a>"; } elseif($ir['investlevel'] == 2) { echo "Thank you for your investment of \$$t".money_formatter($_POST['invest'],'').". At Level 2, you will gain 7.2% interest each day. After 14 days, you can collect your money. <a href = 'index.php' />> Thank you</a> <br /. <a href = 'explore.php' />> Back To The City...</a>"; } } else if($_POST['timetoinvest'] == 3) { $gain=$_POST['invest']; $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d', `userBANKAMMT` = '%d', `userDAYS` = '%d' WHERE `userid` = ('%u')", $_POST['invest'], $gain, 31, $userid)); if($ir['investlevel'] == 0) { echo "Thank you for your investment of \$$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 3.0% interest each day. After 31 days, you can collect your money. [url='index.php']> Thank You[/url] [url='explore.php']> Back To The City...[/url]"; } elseif($ir['investlevel'] == 1) { echo "Thank you for your investment of \$$t".money_formatter($_POST['invest'],'').". At your current program level, you will gain 5.5% interest each day. After 31 days, you can collect your money. <a href = 'index.php' />> Thank You</a> <a href = 'explore.php' />> Back To The City...</a>"; } elseif($ir['investlevel'] == 2) { echo "Thank you for your investment of \$$t".money_formatter($_POST['invest'],'').". At Level 2, you will gain 7.2% interest each day. After 31 days, you can collect your money. <a href = 'index.php' />> Thank you</a> <br /. <a href = 'explore.php' />> Back To The City...</a>"; } } } } function get_invest() { global $db,$ir,$c,$h,$userid; if($ir['userCONTRACT'] == 0) { die("You need to sign a contract before you can collect your money. Go <a href = 'investment.php?action=buyinvest' />HERE</a> to sign a new contract."); } else { print "Thank you for collecting your investment. You have collected \$$t".money_formatter($ir['userBANKAMMT'],'').". Where would you like to deposit it? <form action = 'bank.php' method = 'post' /> <input type = 'submit' value = 'The Bank' name = 'depositbank' /> </form> <form action = 'cyberbank.php' method = 'post' /> <input type = 'submit' value = 'The Cyber Bank' name = 'depositcyber' /> </form> <form action = 'index.php' method = 'post' /> <input type = 'submit' value = 'Go Home' name = 'gohome' /> </form>"; $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d', `userBANKAMMT` = '%d', `userDAYS` = '%d' WHERE `userid` = ('%u')", $ir['userBANKAMMT'], 0, 0, $userid)); } } function level_upgrade() { global $db,$ir,$c,$h,$userid; $upgrade = ($ir['level'] * 3000); if($ir['investlevel'] >= 1) { die("You can't upgrade here as you're at Level {$ir['investlevel']}. <a href = 'index.php' />Go Home</a>"); } else { print "Welcome to the upgrading office. Here, you can upgrade to Level 1, which gives 5.5% interest per day. Would you like to upgrade for \$$t".money_formatter($upgrade,'')."? <form action = 'investment.php?action=levelupgradesub' method = 'post' /> <input type = 'submit' value = 'Yes Please' /> </form> <form action = 'investment.php' method = 'post' /> <input type = 'submit' value = 'No Thanks' /> </form>"; } } function levelupgrade_sub() { global $db,$ir,$c,$h,$userid; $upgrade = ($ir['level'] * 3000); if($ir['userCONTRACT'] == 0) { die("You need to sign a contract with us before you can upgrade. Click <a href = 'investment.php?action=buyinvest' />HERE</a> to sign a contract."); } elseif($ir['investlevel'] >= 1) { die("You can't upgrade here because you're at Level {$ir['investlevel']}. <a href = 'index.php' />Go Home</a>"); } elseif($ir['money'] < $upgrade) { die("You don't have enough money to upgrade at this time. You need \$$t".money_formatter($upgrade,'')." to upgrade. Go to the <a href = 'bank.php' />bank</a> to get some more money."); } else { print "Congratulations. You have been upgraded to Level 1. You will now receive 5.5% interest each day when you have an investment. <a href = 'investment.php' />Go Back</a>"; $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d', `investlevel` = '%d' WHERE `userid` = ('%u')", $upgrade, 1, $userid)); } } function level_upgrade2() { global $db,$ir,$c,$h,$userid; $upgrade2 = ($ir['level'] * 5500); if($ir['userCONTRACT'] == 0) { die("You need to sign a contract with us before you can upgrade. Click <a href = 'investment.php?action=buyinvest' />HERE</a> to sign a contract."); } elseif($ir['investlevel'] == 0) { die("You have to upgrade to Level 1 before you can upgrade to Level 2. Click <a href = 'investment.php?action=levelupgrade' />HERE</a> to upgrade to Level 1."); } elseif($ir['investlevel'] == 2) { die("You are already at Level 2. You can't upgrade any more. <a href = 'index.php' />Click Here</a> to go back."); } else { print "Welcome to the upgrading office. We notice that you are already at Level 1. It will cost you \$$t".money_formatter($upgrade2,'')." to upgrade to Level 2. Would you like to upgrade to Level 2, which gives 7.2% interest per day? <form action = 'investment.php?action=levelupgrade2sub' method = 'post' /> <input type = 'submit' value = 'Yes Please' /> </form> <form action = 'index.php' method = 'post' /> <input type = 'submit' value = 'No Thanks' /> </form>"; } } function levelupgrade2_sub() { global $db,$ir,$c,$h,$userid; $upgrade2 = ($ir['level'] * 5500); if($ir['userCONTRACT'] == 0) { die("You need to sign a contract with us before you can upgrade. Click <a href = 'investment.php?action=buyinvest' />HERE</a> to sign a contract."); } elseif($ir['userDAYS'] > 0) { die("You have to wait for your current investment to finish before you can upgrade to Level 2. <a href = 'index.php' />Go Home</a>"); } elseif($ir['investlevel'] == 0) { die("You must be Level 1 before you can upgrade to Level 2. <a href = 'index.php' />Go Home</a>"); } elseif($ir['investlevel'] == 2) { die("You are already at Level 2. <a href = 'index.php' />Go Home</a>"); } elseif($ir['money'] < $upgrade2) { die("You don't have enough money to upgrade to Level 2. <a href = 'index.php' />Go Home</a>"); } else { print "You have been upgraded to Level 2. You will now receive 7.2% interest per day. <a href = 'index.php' />Go Home</a>"; $sql = sprintf("UPDATE `users` SET `money` = `money` - '%d', `investlevel` = '%d' WHERE `userid` = ('%u')", $upgrade2, 2, $userid); $db->query($sql); } } $h->endpage(); ?> Step 3: Then put this into cron_day.php: $db->query("UPDATE users SET userCONTRACT = userCONTRACT - 1 WHERE userCONTRACT > 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*5.5) WHERE userBANKAMMT > 0 AND investlevel = 1"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*3.0) WHERE userBANKAMMT > 0 AND investlevel = 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*7.2) WHERE userBANKAMMT > 0 AND investlevel = 2"); $db->query("UPDATE users SET userDAYS = userDAYS - 1 WHERE userDAYS != 0"); Step 4: Then add this link: <a href = 'investment.php' />Ian's Investments</a> into explore.php. Then you're done. :) If you find any errors, please post them here. Also, if you decide to use this, please post here. :) Hope you all like it. I'm open to all comments. :)
-
Re: Bar23 [V2] Nice little mod there. +1 from me. :) The second one is much better as it's easier to read and understand. :)
-
Re: [FREE][V2] Club Mod (my version) If anyone is using this, please replace popularitytrade.php. The working one can be found on the first page. I forgot to change all the text and links in one of the functions in the script. Sorry for any inconvenience.
-
Re: [FREE][V2] Club Mod (my version) Sethenor, is it working for you now? Or do you still get those characters in the top corner?
-
Re: [FREE][V2] Club Mod (my version) I've no idea why that is happening. I'll take a look at it when I get home from school. :) It works fine for me though, but I'll see what I can do. :) Its soo annoying lol Right. The reason why you're getting that may be because of the money_formatter in the script. You may have yours set to something completely different. So, remove all of the money_formatter's in the script and see what happens. :) However, I could be completely wrong. :-P And thank you. :)
-
Re: [FREE][V2] Club Mod (my version) I've no idea why that is happening. I'll take a look at it when I get home from school. :) It works fine for me though, but I'll see what I can do. :) And thank you www.mygunwars.com for fixing that up. I hate it when there's such a small error like a missing ). :lol: And thank you. :)
-
Re: [FREE][V2] Club Mod (my version) Thank you. :) I'll hopefully be starting another mod soon, so long as I think of one and I have the time. :)
-
Re: [FREE][V2] Club Mod (my version) It's another way for the user to get money, crystals, etc. :) But to do that, they have to gain Popularity Points by doing activities at the club. When they leave the club, they can go to the trader and exchange their points. :) And thank you for the comments. :)
-
Re: [FREE][V2] Club Mod (my version) Carrying on...... Step 8: Then make a file called popularitytrade.php and paste this in it: <?php /********* Created by: War_Hero Free for: CE Members NOT FOR SALE **********/ include "globals.php"; include "travellingglobals.php"; include "clubbing.php"; if($ir['jail'] OR $ir['hospital']) { die("You can't access this page when in hospital or jail. <a href = 'index.php' />Go Home</a>"); } print "<center /> <b /> <font color = 'yellow' />Your Popularity Points: {$ir['popularity']}</font> [/b] </center> "; switch($_GET['action']) { case 'willtrade': will_trade(); break; case 'moneytrade': money_trade(); break; case 'moneytradesub': money_tradesub(); break; case 'crystalstrade': crystals_trade(); break; case 'crystalstradesub': crystals_tradesub(); break; default: index(); break; } function index() { global $db,$ir,$userid; print "<h2 />Popularity Centre</h2> Hello and welcome to the Popularity Centre. Here, you can trade in your popularity points for different rewards/bonuses. What would you like to do? <table width = '70%' cellspacing = '1' class = 'table' /> <tr /> <th />Reward/Bonus</th> <th />Description</th> <th />Popularity Needed</th> <th />Trade In?</th> </tr> <tr /> <td />Will Refill</td> <td />Gives you [b]ONE[/b] Will refill</td> <td /> <font color = 'green' />20 Popularity</font> </td> <td /> <a href = 'popularitytrade.php?action=willtrade' />Trade</a> </td> </tr> <tr /> <td />Money Trade</td> <td />Gain [b]£2,500[/b] per Popularity point</td> <td /> <font color = 'green' />1 Popularity</font> </td> <td /> <a href = 'popularitytrade.php?action=moneytrade' />Trade</a> </td> </tr> <tr /> <td />Crystals Trade</td> <td />Gain [b]15[/b]Crystals per Popularity point</td> <td /> <font color = 'green' />1 Popularity</font> </td> <td /> <a href = 'popularitytrade.php?action=crystalstrade' />Trade</a> </td> </tr> </table> Or would you like to go home? <form action = 'index.php' /> <input type = 'submit' value = 'Go Home' /> </form>"; } function will_trade() { global $db,$ir,$userid; $setwill = ($ir['maxwill']); if($ir['popularity'] == 0) { die("You don't have any Popoularity Points to trade in. <a href = 'popularitytrade.php' />Go Back</a>"); } elseif($ir['popularity'] < 20) { die("You don't have enough popularity points to trade in for a Will refill. <a href = 'popularitytrade.php' />Go Back</a>"); } elseif($ir['will'] == $ir['maxwill']) { die("You already have full Will. <a href = 'popularitytrade.php' />Go Back</a>"); } else { print "You traded in <font color = 'green' />20 Popularity Points</font> for a <b />100% Will refill[/b]. <a href = 'popularitytrade.php' />Go Back</a>"; $willfill = sprintf("UPDATE `users` SET `will` = '%d', `popularity` = `popularity` - '%d' WHERE `userid` = ('%u')", $setwill, 20, $userid); $db->query($willfill); } } function money_trade() { global $db,$ir,$userid; $_POST['ppoints'] = abs((int) $_POST['ppoints']); if($ir['popularity'] == 0) { die("You don't have any Popularity Points to trade in. <a href = 'popularitytrade.php' />Go Back</a>"); } else { print "<h2 />Trading for Money</h2> Welcome. Here, you can trade in your Popularity Points for money. <font color = 'blue' />Each Popularity Point is worth ".money_formatter(2500)."</font>. How many points would you like to trade in? <form action = 'popularitytrade.php?action=moneytradesub' method = 'post' /> <input type = 'text' name = 'ppoints' value = '1' /> <input type = 'submit' value = 'Trade Popularity Points' /> </form>"; } } function money_tradesub() { global $db,$ir,$userid; $_POST['ppoints'] = abs((int) $_POST['ppoints']); $trade = 2500; $total = $_POST['ppoints'] * $trade; if($ir['popularity'] < $_POST['ppoints']) { die("You don't have enough Popularity Points to trade in that much. <a href = 'popularitytrade.php' />Go Back</a>"); } else { print "<h2 />Trading for Money</h2> You have traded {$_POST['ppoints']} Popularity Points for £".money_formatter($total,'').". Enjoy your money. <a href = 'popularitytrade.php?action=moneytrade' />Trade some more PP's for money</a> <a href = 'popularitytrade.php' />Trade some PP's for something else</a> <a href = 'index.php' />Go Home</a>"; $montrade = sprintf("UPDATE `users` SET `money` = `money` + '%d', `popularity` = `popularity` - '%d' WHERE `userid` = ('%u')", $total, $_POST['ppoints'], $userid); $db->query($montrade); } } function crystals_trade() { global $db,$ir,$userid; $_POST['ppointscrys'] = abs((int) $_POST['ppointscrys']); if($ir['popularity'] == 0) { die("You don't have any Popularity Points to trade in. <a href = 'popularitytrade.php' />Go Back</a>"); } else { print "<h2 />Trading for Crystals</h2> Here, you can trade in your Popularity Points for crystals. <font color = 'blue' />Each Popularity Point is worth 15 crystals.</font> How many points would you like to trade in? <form action = 'popularitytrade.php?action=crystalstradesub' method = 'post' /> <input type = 'text' name = 'ppointscrys' value = '1' /> <input type = 'submit' value = 'Trade Popularity Points' /> </form>"; } } function crystals_tradesub() { global $db,$ir,$userid; $_POST['ppointscrys'] = abs((int) $_POST['ppointscrys']; $ctrade = 15; $ctotal = $_POST['ppointscrys'] * $ctrade; if($ir['popularity'] < $_POST['ppointscrys']) { die("You don't have enough Popularity Points to trade in this much. <a href = 'popularitytrade.php' />Go Back</a>"); } else { print "<h2 />Trading for Crystals</h2> You have traded {$_POST['ppointscrys']} for $ctotal crystals. Enjoy your crystals. <a href = 'popularitytrade.php?action=crystalstrade' />Trade some more PP's for crystals</a> <a href = 'popularitytrade.php' />Trade some PP's for something else</a> <a href = 'index.php' />Go Home</a>"; $crystrade = sprintf("UPDATE `users` SET `popularity` = `popularity` - '%d', `crystals` = `crystals` + '%d' WHERE `userid` = ('%u')", $_POST['ppointscrys'], $ctotal, $userid); $db->query($crystrade); } } $h->endpage(); ?> Step 9: This small bit of code ensures that users can not access certain pages when travelling. Call it travellingglobals.php: <?php if($ir['traveltime'] > 0) { die("<p style='color: red;font-weight: bold;font-size: 2' />You are travelling for {$ir['traveltime']} minutes. Please wait until you arrive at your destination to access this page.</font> <center> [url='index.php']Go Home[/url] </center>"); } ?> Step 10: Create a file called clubbing.php and paste this in it: <?php if($ir['club'] == 1) { die("You can not access this page when you are at the Club. <a href = 'club.php?action=clubbing' />Go Back To Club</a> <a href = 'club.php?action=travelhome' />Leave Club</a> "); } elseif($ir['alcohol'] >=18) { die("You're too drunk to access this page. <a href = 'clubrecover.php' />Go To Recovery Centre</a>"); } ?> Put include "clubbing.php"; at the top of every page under include "globals.php"; that you don't want the user to access when they are at the club or if they are drunk. If you find any errors or bugs, or need help with it, please reply to this post or send me a message and I'll reply as quickly as I can. (I'm back at school now). Also, please post here if you use this mod. :) I've secured it to the best of my ability. Hope you all enjoy. I will accept all comments. :)
-
Re: [FREE][V2] Club Mod (my version) Carried on.... Step 6: Then make a file called club.php and paste this into it: <?php /********* Created by: War_Hero Free for: CE Members NOT FOR SALE **********/ include "globals.php"; include "travellingglobals.php"; if($ir['jail'] or $ir['hospital']) { die("You can't access the club when you're in Jail or Hospital. <a href = 'index.php' />Go Home</a>"); } if($ir['clubvisits'] == 3) { die("You've already visited the Club 3 times today. You'll put your life at risk if you go there again. <a href = 'index.php' />Go Home</a>"); } switch($_GET['action']) { case 'clubtravel': club_travel(); break; case 'clubbing': clubbing(); break; case 'drinkbeer': drink_beer(); break; case 'drinkvodka': drink_vodka(); break; case 'drinkjimbeam': drink_jimbeam(); break; case 'spikedrink': spike_drink(); break; case 'dance': dance(); break; case 'dare': dare(); break; case 'travelhome': travel_home(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; if($ir['traveltime'] > 0) { die("You're travelling to the club. You will arrive in {$ir['clubtravel']} minutes. <a href = 'index.php' />Go Home</a>"); } elseif($ir['club'] > 0) { die("You're already at the club. <a href = 'club.php?action=clubbing' />Return to the club</a>"); } elseif($ir['alcohol'] >= 18) { die("You're too drunk to travel to the Club. <a href = 'clubrecover.php' />Go To Recovery Centre</a>"); } else { print "<h2 />The Club</h2> Would you like to travel to the Club? It will take up to 5 minutes to get there, depending on the traffic. <form action = 'club.php?action=clubtravel' method = 'post' /> <input type = 'submit' value = 'Travel' /> </form> <form action = 'index.php' /> <input type = 'submit' value = 'Go Home' /> </form>"; } } function club_travel() { global $db,$ir,$c,$h,$userid; $rantime = rand(2,5); if($ir['traveltime'] > 0) { die("You're already travelling to the Club. <a href = 'club.php?action=clubbing' />Return</a>"); } elseif($ir['club'] > 0) { die("You're already at the Club. <a href = 'club.php?action=clubbing' />Return to the Club</a>"); } else { print "<h3>Travelling to the Club</h3> You're now travelling to the Club. You won't be able to access many of the features when you're at the club. Hope you have a good time."; $sql = sprintf("UPDATE `users` SET `club` = '%d', `traveltime` = '%d' WHERE `userid` = ('%u')", 1, $rantime, $userid); $db->query($sql); } } function clubbing() { global $db,$ir,$c,$h,$userid; if($ir['alcohol'] >= 18) { die("You've had enough alcohol for one day. You need to go home. <a href = 'club.php?action=travelhome' />Click Here To Go Home</a>"); } elseif($ir['club'] != 1) { die("You need to be at the Club to go clubbing. <a href = 'index.php' />Go Home</a>"); } elseif($ir['traveltime'] > 0) { die("You're currently travelling to the Club. <a href = 'index.php' />Home</a>"); } else { print "<h3 />Clubbing</h3> <center /> <font color = 'pink' />Your Dare: {$ir['dare']}</font> <font color = '#3BB9FF' />Your Popularity: {$ir['popularity']}</font> <font color = 'red' />Your Alcohol Level: {$ir['alcohol']}</font> </center> <center /> <h4 />DRINKS<h4 /> </center> <table width = '80%' cellspacing = '1' class = 'table' /> <tr /> <th />Drink Name</th> <th />Cost per Drink</th> <th />Alcohol Unit</th> <th />Dare Increase</th> <th />Drink?</th> </tr> <tr /> <td />Beer</td> <td />\$1,100</td> <td />2 units</td> <td />+3 Dare</td> <td /> <a href = 'club.php?action=drinkbeer' />Drink</a> </td> </tr> <tr /> <td />Vodka</td> <td />\$2,300</td> <td />4 units</td> <td />+5 Dare</td> <td /> <a href = 'club.php?action=drinkvodka' />Drink</a> </td> </tr> <tr /> <td />Jim Beam</td> <td />\$2,800</td> <td />5 units</td> <td />+7 Dare</td> <td /> <a href = 'club.php?action=drinkjimbeam' />Drink</a> </td> </tr> </table> <center /> <h4 />Other Actions</h4> </center> <table width = '80%' cellspacing = '1' class = 'table' /> <tr /> <th />Action</th> <th />Description</th> <th />Do?</th> </tr> <tr /> <td />Spike Drink</td> <td />Gives you a slight boost!</td> <td /> <a href = 'club.php?action=spikedrink' />Spike Drink</a> </td> </tr> <tr /> <td />Dance</td> <td />Wears you down, but makes you happy!</td> <td /> <a href = 'club.php?action=dance' />Start Dancing</a> </td> </tr> <tr /> <td />Be Daring</td> <td />Perform a stunt or two to become popular!</td> <td /> <a href = 'club.php?action=dare' />Be a Dare-Devil</a> </td> </tr> <tr /> <td />Travel Home</td> <td />You've had enough, and want to go home</td> <td /> <a href = 'club.php?action=travelhome' />Head Home</a> </td> </tr> </table>"; } } function drink_beer() { global $db,$ir,$c,$h,$userid; $beer = 1100; if($ir['alcohol'] >= 18) { die("You've already drunk enough alcohol for one day. <a href = 'club.php?action=clubbing' />Go Back</a>"); } elseif($ir['money'] < 1100) { die("You don't have enough money to buy a beer. <a href = 'club.php?action=clubbing' />Go Back</a"); } else { $addbeer = ($ir['alcohol'] + 2); print "<h3 />Drinking</h3> You drank a beer. Your dare went up by 3 units and your alcohol level went up by 2 units. <font color = 'red' />Your alcohol level is now at $addbeer units.</font> <a href = 'club.php?action=drinkbeer' />Have another beer</a> <a href = 'club.php?action=clubbing' />Back</a>"; $drinkbeer = sprintf("UPDATE `users` SET `alcohol` = `alcohol` + '%d', `money` = `money` - '%d', `dare` = `dare` + '%d' WHERE `userid` = ('%u')", 2, $beer, 3, $userid); $db->query($drinkbeer); } } function drink_vodka() { global $db,$ir,$c,$h,$userid; $vodka = 2300; if($ir['alcohol'] >= 18) { die("You've already drunk enough alcohol for one day. <a href = 'club.php?action=clubbing' />Go Back</a>"); } elseif($ir['money'] < 2300) { die("You don't have enough money to buy a shot of vodka. <a href = 'club.php?action=clubbing' />Go Back</a>"); } else { $addvodka = ($ir['alcohol'] + 4); print "<h3 />Drinking</h3> You took a shot of vodka and feel the effects straight away. Your dare went up by 5 units and your alcohol level went up by 4 units. <font color = 'red' />Your alcohol level is now at $addvodka units.</font> <a href = 'club.php?action=drinkvodka' />Have another vodka shot</a> <a href = 'club.php?action=clubbing '>Back</a>"; $drinkvodka = sprintf("UPDATE `users` SET `alcohol` = `alcohol` + '%d', `money` = `money` - '%d', `dare` = `dare` + '%d' WHERE `userid` = ('%u')", 4, $vodka, 5, $userid); $db->query($drinkvodka); } } function drink_jimbeam() { global $db,$ir,$c,$h,$userid; $jimbeam = 2800; if($ir['alcohol'] >= 18) { die("You've already drunk enough for one day. <a href = 'club.php?action=clubbing' />Go Back</a>"); } elseif($ir['money'] < 2800) { die("You don't have enough money to buy a glass of Jim Beam. <a href = 'club.php?action=clubbing' />Go Back</a>"); } else { $addjim = ($ir['alcohol'] + 5); print "<h3 />Drinking</h3> You downed a glass of Jim Beam in one. Your dare went up by 7 units and your alcohol level went up by 5 units. <font color = 'red' />Your alcohol level is now at $addjim units.</font> <a href = 'club.php?action=drinkjimbeam' />Have another glass of Jim Beam</a> <a href = 'club.php?action=clubbing' />Back</a>"; $drinkjimbeam = sprintf("UPDATE `users` SET `alcohol` = `alcohol` + '%d', `money` = `money` - '%d', `dare` = `dare` + '%d' WHERE `userid` = ('%u')", 5, $jimbeam, 7, $userid); $db->query($drinkjimbeam); } } function spike_drink() { global $db,$ir,$c,$h,$userid; $smon = rand(10000,17500); if($ir['alcohol'] >= 18) { die("You're too drunk to spike a drink. <a href = 'club.php?action=clubbing' />Go Back</a>"); } if($ir['alcohol'] < 5) { die("You need to have at least 5 units of alcohol in you to spike a drink. <a href = 'club.php?action=clubbing' />Go Back</a>"); } elseif($ir['dare'] < 10) { die("You need to have at least 10 dare before you can spike a drink! <a href = 'club.php?action=clubbing' />Go Back</a>"); } else { $spike = sprintf("UPDATE `users` SET `alcohol` = `alcohol` - '%d', `dare` = `dare` - '%d', `money` = `money` + '%d' WHERE `userid` = ('%u')", 2, 10, $smon, $userid); $db->query($spike); print "<h3 />Spiking a Drink</h3> You see a glass sitting on a table by its self. The 'owner' has gone to the toilet. You pull out a small bag containing several pills. You drop a pill in the person's drink and casually walk away. Your dare has gone down, but so has your alcohol level! You also gained \$".money_formatter($smon,'')." for doing it! <a href = 'club.php?action=clubbing' />Back</a>"; } } function dance() { global $db,$ir,$c,$h,$userid; if($ir['alcohol'] >= 18) { die("You're too drunk to dance. <a href = 'club.php?action=clubbing' />Go Back</a>"); } if($ir['energy'] != $ir['maxenergy']) { die("You need to have full energy to dance. <a href = 'club.php?action=clubbing' />Go Back</a>"); } else { $popdance = ($ir['popularity'] + 2); print "<h3 />Dancing</h3> You start dancing on the dance floor, showing off all you slick moves. While grooving, your popularity goes up, but you get tired. <font color = 'green' />Your popularity is now at $popdance. <a href = 'club.php?action=clubbing' />Back</a>"; $dancing = sprintf("UPDATE `users` SET `popularity` = `popularity` + '%d', `energy` = `energy` / '%d' WHERE `userid` = ('%u')", 2, 2, $userid); $db->query($dancing); } } function dare() { global $db,$ir,$c,$h,$userid; $dodare = rand(1,3); if($ir['dare'] < 12) { die("You need at least 12 dare before you can perform any kind of stunt/trick. <a href = 'club.php?action=clubbing' />Go Back</a>"); } elseif($ir['alcohol'] >= 18) { die("You're too drunk to perform any tricks/stunts. <a href = 'club.php?action=clubbing' />Go Back</a>"); } else { if ($dodare == 1) { $cash = rand(25000,50000); $pop1 = ($ir['popularity'] + 5); print "<h3 />Being a Dare-Devil</h3> You decide to be a dare-devil and climb to the top of a building and walk along the edge it. The crowd below gasps as you jump from one building to another. You get back to ground level and are greeted with applaude. You're popularity went up and you received \$".money_formatter($cash,'')." for your amazing stunt! <font color = 'green' />Your popularity is now at $pop1.</font> <a href = 'club.php?action=clubbing' />Back</a>"; $dare1 = sprintf("UPDATE `users` SET `money` = `money` + '%d', `dare` = `dare` - '%d', `popularity` = `popularity` + '%d' WHERE `userid` = ('%u')", $cash, 8, 5, $userid); $db->query($dare1); } if ($dodare == 2) { $cash2 = rand(5000,7000); $pop2 = ($ir['popularity'] - 3); print "<h3 />Being a Dare-Devil</h3> You decide to be a dare-devil and try to dodge on-coming traffic. You dodge the first 3 cars to wonderful applause, but you get hit by a speeding lorry. You wake up in hospital after receiving \$".money_formatter($cash2,'')." for your efforts. Unfortunately, you lost some popularity. <font color = 'red' />Your popularity is now at $pop2.</font> <a href = 'hospital.php' />Go To Hospital</a>"; $dare2 = sprintf("UPDATE `users` SET `money` = `money` + '%d', `dare` = `dare` - '%d', `club` = '%d', `clubvisits` = `clubvisits` + '%d', `hospital` = `hospital` + '%d', `hospreason` = 'Got hit by a car while being a dare-devil' WHERE `userid` = ('%u')", $cash2, 8, 0, 1, 150, $userid); $db->query($dare2); $dare2a = sprintf("UPDATE `users` SET `popularity` = `popularity` - '%d' WHERE `userid` = ('%u') AND `popularity` >= '%d'", 3, $userid, 3); $db->query($dare2a); } if ($dodare == 3) { $pop = rand(1,3); $gc = rand(50,75); $pop3 = ($ir['popularity'] + $pop); print "<h3 />Being a Dare-Devil</h3> You decide to be a dare-devil and run around the streets naked. You purposely run into people, making them feel sick. When you get your clothes back on, you receive <font color = 'gold' />$gc Golden Coins</font> and gain $pop popularity. <font color = 'green' />Your popularity is now at $pop3</font>. <a href = 'club.php?action=clubbing' />Go Back</a>"; $dare3 = sprintf("UPDATE `users` SET `crystals` = `crystals` + '%d', `popularity` = `popularity` + '%d', `dare` = `dare` - '%d' WHERE `userid` = ('%u')", $gc, $pop, 8, $userid); $db->query($dare3); } } } function travel_home() { global $db,$ir,$c,$h,$userid; $rand = rand(6,9); if($ir['club'] != 1) { die("You're not at the club. <a href = 'index.php' />Go Home</a>"); } else { $home = rand(1,3); if ($home == 1) { print "<h3 />Travelling Home</h3> Your friends give you a lift home. There aren't any probems and you get home safely. It takes you $rand minutes to get home."; $home1 = sprintf("UPDATE `users` SET `traveltime` = '%d', `club` = '%d', `clubvisits` = `clubvisits` + '%d' WHERE `userid` = ('%u')", $rand, 0, 1, $userid); $db->query($home1); } if ($home == 2) { $hospt = rand(120,165); print "<h3 />Travelling Home</h3> When travelling home with your friends, the car swerves off the road when the drivers loses concentration. The car hits into a tree and everyone inside is severly injured. You go to hospital for $hospt minutes. It takes you $rand minutes to get home as well."; $home2 = sprintf("UPDATE `users` SET `traveltime` = '%d', `club` = '%d', `clubvisits` = `clubvisits` + '%d', `hospital` = `hospital` + '%d', `hospreason` = 'Was severly injured in a car crash', `hp` = '%d' WHERE `userid` = ('%u')", $rand, 0, 1, $hospt, 0, $userid); $db->query($home2); } if ($home == 3) { $jail = rand(4,8); print "<h3 />Travelling Home</h3> When travelling home, you friend decides to speed and drive dangerously. You encourage him to continue. As you speed round a corner, a space ranger turns on his blues and orders you to pull over. You do so. You go to jail for $jail minutes. It also takes you $rand minutes to get home."; $home3 = sprintf("UPDATE `users` SET `traveltime` = '%d', `club` = '%d', `clubvisits` = `clubvisits` + '%d', `jail` = `jail` + '%d', `jail_reason` = 'Got caught speeding' WHERE `userid` = ('%u')", $rand, 0, 1, $jail, $userid); $db->query($home3); } } } $h->endpage(); ?> Step 7: Then make a file called clubrecover.php and paste this in it: <?php /********* Created by: War_Hero Free for: CE Members NOT FOR SALE **********/ include "globals.php"; include "travellingglobals.php"; if($ir['jail'] or $ir['hospital']) { die("You can not rid the alcohol in your system when you're in jail or hospital. <a href = 'index.php' />Go Home</a>"); } elseif($ir['alcohol'] == 0) { die("You don't have any alcohol in your system, so there's no need to recover. <a href = 'index.php' />Go Home</a>"); } elseif($ir['club'] == 1) { die("You need to leave the Club before you can go to the Recovery Centre. <a href = 'club.php?action=travelhome' />Leave Club</a>"); } switch($_GET['action']) { case 'recover': recover(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; $rid = ($ir['alcohol'] * 1200); print "<h2 />Recovery Centre</h2> Welcome to the Recovery Centre. Here, you can rid the alcohol from your system. <font color = 'red' />At the moment, you have {$ir['alcohol']} units in your system.</font> You can rid your alcohol for \$".money_formatter($rid,'').". Would you like to rid your system of alcohol? <form action = 'clubrecover.php?action=recover' method = 'post' /> <input type = 'submit' value = 'Yes' /> </form> <form action = 'index.php' /> <input type = 'submit' value = 'No' /> </form>"; } function recover() { global $db,$ir,$c,$h,$userid; $rid = ($ir['alcohol'] * 1200); if($ir['alcohol'] == 0) { die("You don't have any alcohol in your system. <a href = 'index.php' />Go Home</a>"); } elseif($ir['money'] < $rid) { die("You don't have enough money to rid the alcohol from your system. <a href = 'index.php' />Go Home</a>"); } else { print "<h2 />Recovering</h2> You have successfully rid your system of alcohol for £\$".money_formatter($rid,'').". <a href = 'index.php' />Go Back Home</a>"; $ridding = sprintf("UPDATE `users` SET `money` = `money` - '%d', `alcohol` = '%d' WHERE `userid` = ('%u')", $rid, 0, $userid); $db->query($ridding); } } $h->endpage(); ?> Continued in next post..... ;)
-
Hi all. This is my third or fourth mod on here. I coded this by myself and all of it has been done from scratch. :) Name: Club Mod Description: This mod will allow the user to travel to the Club for a bit of fun. When they arrive at the club, they can have a few drinks, dance and commit dares. However, the user has to build up there dare by drinking alcoholic drinks. But they have to be careful they don't drink too much, otherwise they won't be able to do anything. If the user successfully commits a dare, they will gain some Popularity Points. They will also gain some Popularity Points by dancing. The user can also spike a drink for some money. When they decide to leave or are forced to leave, the user has to go to the Recovery Centre to rid themselves of alcohol. After they've done this, they can access other pages. Next, the user can go to the Popularity Points Trader to trade in their popularity points for bonuses. One bonus is a will refill which costs 20 Popularity Points. Now for installing the mod: Step 1: Run this SQL: ALTER TABLE `users` ADD `traveltime` INT(11) NOT NULL DEFAULT '0', ADD `club` INT(11) NOT NULL DEFAULT '0', ADD `popularity` INT(11) NOT NULL DEFAULT '0', ADD `dare` INT(11) NOT NULL DEFAULT '5', ADD `alcohol` INT(11) NOT NULL DEFAULT '0', ADD `clubvisits` INT(11) NOT NULL DEFAULT '0'; Step 2: In cron_day.php add: $db->query("UPDATE users SET dare = 5"); $db->query("UPDATE users SET clubvisits = 0"); Step 3: In cron_minute.php add: $db->query("UPDATE users SET traveltime = traveltime - 1 WHERE traveltime > 0"); Step 4: Add this into header.php: if($ir['club'] == 1) { print "<a href = 'club.php?action=clubbing' /><font color = '#7D053F' />[b]Go Clubbing![/b]</font></a> "; } if($ir['traveltime'] > 0) { print "<font color = 'brown' />Travelling for [b]{$ir['traveltime']} minutes[/b].</font> "; } if($ir['alcohol'] >=18) { print "<a href = 'clubrecover.php' /><font color = 'red' size = '2' />[b]Go To Recovery Centre[/b]</font></a> "; } Step 5: Add in explore.php under include "globals.php": include "travellingglobals.php"; include "clubbing.php"; Then add anywhere in explore.php: <a href = 'club.php' />Club</a> <a href = 'clubrecover.php' />Recovery Centre</a> <a href = 'popularitytrade.php' />Popularity Point Trader</a> Will be continued in next post. :)
-
Re: [V2] SafeHouse Nice modification there. :) Keep up the good work. ;)
-
Re: Just a heads up to all game owners! Woops. I left out a bit in that sentence. :-P I meant to say: Chedburn claims he has copyright on images, but the images he uses can probably be found on Google, so therefore not copyrighted to him or TC....if that makes sense. I'm tired after a long day at school. That's my excuse. :-P
-
Re: Just a heads up to all game owners! The users on TC are all 'congratulating' and praising Chedburn for shutting down a supposedly TC Copycat game. Unless Chedburn has copyright on his images, which, I believe, most can be found on Google, most games will be fine and he can't do anything to it. ;) But as clearly stated by Extermination:
-
Re: Sick & Tired I can't possibly see why he'd say that, as you've been coding for much longer than I have. In my own honest opinion, I still think I'm a newbie to PHP, as I'm still learning. I've got the basics and what-not, just developing my skills to a higher level. ;) But as you clearly said (dementor), it doesn't really matter who's better than who. ;)
-
Re: Sick & Tired Hmm...I honestly don't see why my name would be in that list. I'm not that good of a coder. I've only been coding PHP for a month and a bit, so I'm still learning. I've only made a few mods and edited a few. I'm struggling with one at the moment! :-P In my honest opinion, I'm no match for most of the coders/programmers on that list and therefore wouldn't really suit the competition, if there was to be one. ;)
-
Re: [Free V2] Lottery You could try this: <?php include ("./config.php"); global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } 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(); $c=$db->connection_id; include("./global_func.php"); $sql = $db->query("SELECT * FROM `lottery`"); $rows = $db->num_rows($sql); $row = $db->fetch_row($sql); $winner = rand(1,$rows); $winnerq = sprintf("SELECT `userid` FROM `lottery` WHERE `id` = %d", $winner); $winnerq1 = $db->query($winnerq); $user = $db->fetch_row($winnerq1); $credit = sprintf("UPDATE `users` SET `money` = `money` + %d WHERE `userid` = (%u)", $row['jackpot'], $user['userid']); event_add($user['userid'],"You won the weekly lottery and were credited £{$row['jackpot']}",$c); $db->query("INSERT INTO announcements VALUES('User ID {$user['userid']} won the weekly lottery. Well done!', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query($credit); $db->query("UPDATE `users` SET `lottery` = 0"); $db->query("TRUNCATE TABLE `lottery`"); This code also adds an announcement saying who won the lottery. :)
-
Re: [Free V2] Lottery Do you want to post that particular bit of the cron here so we can take a look at it? :)
-
Re: Please help... Is anyone able to help me? I'm doing my best to fix it, but I can't work it out. :| I will be grateful for any help. :)
-
Re: Playstation 3 I haven't played on the XBOX 360 much, as I don't own one. :-P However, I will agree that online play is better on the XBOX 360 than it is on the PS3. Same with the general online community.
-
Hi all. I'm creating a mod for my brother's game and I'm having a bit of trouble with it. Brief Description: The mod will allow the Donation Fund President to buy medical equipment and chemicals to cure a disease. The cost of each item will be deducted from the donation fund. My Problem: I've tried to code it so that the President can't buy more than one of the same item at a time and they have to buy medical equipment before they can produce medicine. However, I can buy multiple Chemical 1's (one of the medical items). And even if I buy the Medical Equipment (another item), I can't access the Produce Medicine bit. I'll post the two functions that contain these problems. I'm not experiencing any errors, just what I explained above. President Page function: function pres_itemsbuy() { global $db,$ir,$h,$c,$userid; $_GET['ID'] = abs((int) $_GET['ID']); $q = ("SELECT * FROM `items` WHERE `itmid` = {$_GET['ID']}"); $itemd = ($db->query($q)); $sql1 = ("SELECT * FROM `researchitems`"); $query1 = $db->query($sql1); $row1 = $db->fetch_row($query1); $qq = $db->query(sprintf("SELECT * FROM `items` WHERE `itmid` = '%d'", $_GET['ID'])); while($r = $db->fetch_row($itemd)) { $price = ($r['itmbuyprice']); if($ir['fundpres'] == 0) { die("You need to be President of the Research Fund to buy items. <a href = 'index.php' />Go Home</a>"); } if(mysql_num_rows($qq) == 0) { die("Invalid item ID"); } elseif($_GET['ID'] == $row1['itemID']) { print "You have already purchased this item. <a href = 'researchfund.php?action=prespage' />Go Back</a>"; $h->endpage(); exit; } elseif($row1['totalfund'] < $r['itmbuyprice']) { print "There is not enough money in the Research Fund to buy this item. <a href = 'researchfund.php?action=prespage' />Go Back</a>"; $h->endpage(); exit; } else { $u = sprintf("UPDATE `researchitems` SET `totalfund` = `totalfund` - '%d'", $price); $db->query($u); $u2 = sprintf("INSERT INTO `researchitems` (ID, itemID, itemPRICE) VALUES (%d, %d, %d)", '', $_GET['ID'], $r['itmbuyprice']); $db->query($u2); print "You purchased {$r['itmname']} for £".money_formatter($price,'').". <a href = 'researchfund.php?action=prespage' />Click here to return</a>"; } } } And the Produce Medicine function: function med_create() { global $db,$ir,$userid; $select = ("SELECT * FROM `researchitems`"); $qselect = $db->query($select); $rowselect = $db->fetch_row($qselect); if($rowselect['itemID'] != 105) { die("You don't have the correct medical equipment to produce medicine. You need to buy the equipment first. <a href = 'researchfund.php' />Return to Research Fund</a>"); } elseif($rowselect['itemID'] != 96 OR $rowselect['itemID'] != 97 OR $rowselect['itemID'] != 98 OR $rowselect['itemID'] != 99 OR $rowselect['itemID'] != 100 OR $rowselect['itemID'] != 101) { die("You don't have any chemicals or substances to produce any medicine. <a href = 'researchfund.php' />Return to Research Fund</a>"); } elseif($rowselect['itemID'] == 96 AND $rowselect['itemID'] == 97) { print "<form action = 'researchfund.php?action=medcreate1' /> <input type = 'submit' value = 'Produce Medicine 1' /> </form>"; } elseif($rowselect['itemID'] == 98 AND $rowselect['itemID'] == 99) { print "<form action = 'researchfund.php?action=medcreate2' /> <input type = 'submit' value = 'Produce Medicine 2' /> </form>"; } elseif($rowselect['itemID'] == 100 AND $rowselect['itemID'] == 101) { print "<form action = researchfund.php?action=medcreate3' /> <input type = 'submit' value = 'Produce Medicine 3' /> </form>"; } else { print "Either you've produced all of the medicine or you don't have the correct chemicals or substances. <a href = 'research.php' />Return to Research Fund</a>"; } } I also have functions to create 3 types of medicine, but I can't test them until I fix this, so I may experience some problems with those too. Please note that I am still a newbie coder and any help will be highly appreciated. :)
-
Re: Playstation 3 I've got a PS3 and think it's great. :) My favourite games, of the ones I have, has got to be either GTA IV, GRAW2 or FIFA 08. I never really got into R: FoM or Motorstorm, but play them occasionally. My PSN, if you want it, is COV4LIFE123 :)
-
Re: [Free V2] Lottery You just change the 100 to any number you want. This code allows the user to buy a maximum of 10 lottery tickets. <?php include "globals.php"; switch($_GET['action']) { case 'buysub': buy_sub(); break; default: index(); break; } function index() { global $db,$ir,$userid; $cost = 1000; $tick = 10; $sql = sprintf("SELECT * FROM `lottery`"); $query = $db->query($sql); $row = $db->fetch_row($query); echo sprintf(" <font color = 'yellow' size = '4' /><b /> Welcome to the Nation Jackpot. You currently have %d tickets and are able to purchase up to %d tickets per week. Each ticket costs £%d. The jackpot is £%u.", $ir['lottery'], $tick, $cost, $row['jackpot']); echo " <form action = 'lottery.php?action=buysub' method = 'post' /> <input type = 'text' name = 'buysub' value = '1' /> <input type = 'submit' value = 'Buy Tickets' /> </form>"; } function buy_sub() { global $db,$ir,$userid; $_POST['buysub'] = abs((int) $_POST['buysub']); $cost = 1000; $price = $cost * $_POST['buysub']; if($_POST['buysub'] > 10) { die("You can't buy more than 10 lottery tickets. <a href = 'index.php' />Go Home</a>"); } if($ir['lottery'] >= 10) { die("You have already purchased 10 tickets this week. <a href = 'index.php' />Go Home</a>"); } if($_POST['buysub'] + $ir['lottery'] > 10) { die("You can't buy this many tickets because you would exceed the maximum amount of allowed tickets. <a href = 'index.php' />Go Home</a>"); } if($ir['money'] < $price) { die("You don't have enough money to buy {$_POST['buysub']} tickets. <a href = 'index.php' />Go Home</a>"); } else { print "You have bought {$_POST['buysub']} lottery tickets. <a href = 'index.php' />Go Home</a>"; $sql = sprintf("UPDATE `users` SET `lottery` = `lottery` + '%d', `money` = `money` - '%d' WHERE `userid` = ('%u')", $_POST['buysub'], $price, $userid); $db->query($sql); $sql1 = sprintf("INSERT INTO `lottery` (id,userid, amount) VALUES (%d,%u, %d)", '',$userid, $price); $db->query($sql1); $sql2 = sprintf("UPDATE `lottery` SET `jackpot` = `jackpot` + '%d'", $price); $db->query($sql2); } } $h->endpage(); ?> EDIT: My grammar was appauling. So I just reworded a sentence. :-P