
The Bonded Game
Members-
Posts
29 -
Joined
-
Last visited
The Bonded Game's Achievements
Newbie (1/14)
0
Reputation
-
After many edits I think I got this debugged. <?php /*----------------------------------------------------- -- Ignore User For MC Code V2 -- Free Mod -- <a href="http://www.squangle.org" target="_blank">http://www.squangle.org</a> -- By Tonka -- ignore.php -----------------------------------------------------*/ include "globals.php"; switch($_GET['action']) { case 'ignoreform': ignore_form(); break; case 'ignoresub': ignore_submit(); break; case 'unignore': unignore(); break; default; index(); break; } function index() { global $db,$userid; echo "<h3>Ignoring a user</h3> <a href='ignore.php?action=ignoreform'>Add User To Be Ignored</a> <table width=100% class=\"table\" border=\"10\" cellspacing=\"1\"> <tr><th>User ID</th> <th>Username</th> <th>Remove?</th> <th>Reason</th> <th>Status</th></tr>"; $sql = sprintf(("SELECT `id`, `blocked`, `reason` FROM `ignore` WHERE userid = %u"), $userid); $q = $db->query($sql); while($r=$db->fetch_row($q)) { $select = sprintf(("SELECT `username`, `laston` FROM `users` WHERE userid = %u"), $r['blocked']); $u2 = $db->query($select); $u=$db->fetch_row($u2); $username = $u['username']; $id = $r['id']; if($u['laston'] >= time()-15*60) { $on='<font color=green><b>Online</b></font>'; } else { $on='<font color=red><b>Offline</b></font>'; } echo '<tr><td>'; echo sprintf("%u", $r['blocked']); echo '</td><td>'; echo '<a href="viewuser.php?u='; echo sprintf("%u", $r['blocked']); echo '">'; echo $username; echo '</a>'; echo '</td><td>'; echo '<a href="'.$_SERVER['PHP_SELF'].'?action=unignore&id='; echo $id; echo '">Remove</a>'; echo '</td><td>'; echo $r['reason']; echo '</td><td>'; echo $on; echo '</td></tr>'; } echo "</table>"; } function ignore_form() { echo '<h3>Ignore Mail From A Specified User</h3> The user will not be able to send you ingame mail. <form action="'.$_SERVER['PHP_SELF'].'?action=ignoresub" method="post"> ID of person to ignore: <input type="text" name="blid" /><br /> Reason For User Ignore: <input type="text" name="reason" /> <input type="submit" value="Ignore Future Mail" /></form>'; } function ignore_submit() { global $db,$userid; $blid = mysql_real_escape_string($_POST['blid']); $reson = mysql_real_escape_string($_POST['reason']); $select = sprintf(("SELECT `userid`, `user_level` FROM `users` WHERE userid = %u"), $blid); $ul2 = $db->query($select); $ul=$db->fetch_row($ul2); if(empty($blid) or $blid == 0) { echo 'You did not enter a userid.<br />' ; } else if($ul['userid'] != $blid) { echo 'You can not ignore a non-existant user.' ; } else if($ul['user_level'] != 1) { echo 'You can not ignore staff.' ; } else if($blid == $userid) { echo 'You can not ignore yourself. '; } else { $insert = sprintf("INSERT INTO `ignore` (`userid`, `blocked`, `reason`) VALUES('%u', '%u', '{$_POST['reason']}')", $userid, $blid, $reason); $db->query($insert); echo "Users Mail will be Ignored.<br /> <a href='ignore.php'>Return to ignore</a>"; } } function unignore() { global $db,$userid; $delete = sprintf(("DELETE FROM `ignore` WHERE id=%u AND userid=%u"), mysql_real_escape_string($_GET['id']), $userid); $db->query($delete); echo "User un-ignored.<br /> <a href='ignore.php'>Return to ignore</a>"; } $h->endpage(); ?>
-
Things I would like the newspaper module to include. 1. Multiple pages. (5 by preference). 2. Ability for players to add an advert on any page at a cost. (and to be able to delete their own advert). When players post it should show there name, id number and be a click-able link to their profile. 3. A limit of posts per player. 4. All items needed to add module. 5. Fully secured. 6. The text to auto scroll unless moused over which will result in a pause at that point. 7. BB Code enabled. 8. A place above and below display of adds for me to customize the text. 9. The ability to have the newspaper delete adverts after a certain number of days. (6&7 are optional but I would really like them.) Please mail me, or post here with a price.
-
Good luck getting any response from Raven. The code is stolen from McCodes. You need to purchase a McCodes license for your game.
-
I have a few problems with this. 1)What if your players gang goes to war after they have attacked all they can? 2)This would hamper leveling big time. 3)Attacking NPCs would take away your count. 4)Players offline should be considered NPCs as well but this would still reduce count. If someone wants to add though they should at least consider these points. Code seems simple enough and workable. A Question; if a player is attacked and he loses/wins does that affect the counter? I do not think so but I would want to double check it.
-
Ok, with the help of Aderick, and Corrupt City plus others on this thread I think we now have a fully functional mod. I am going to do my best here to Post it. It will Have three (3) Separate pieces. Spelling and text should be cleaned up for your game. If anyone finds anything that needs cleaning up (besides text/spelling) I will happily edit it on this post. Please just pm me with what needs changing. I did not write any of this code, nor did I secure it, nor do I claim any ownership of it. DO NOT ATTEMPT TO JUST SIMPLY COPY AND PASTE THIS IN TO YOUR GAME UNLESS YOU ARE AN EXPERIENCED CODER. I know the table code is wrong, and the header code is most likely wrong. But, if you know how to work with these and can make the adjustments go for it!! A)The Main monorail php code. <?php //Debugged and code protected by Aderik// require_once(DIRNAME(__FILE__) . '/globals.php'); $_GET['to'] = isset($_GET['to']) && is_numeric($_GET['to']) ? abs((int) $_GET['to']) : false; $_GET['stop'] = isset($_GET['stop']) && is_numeric($_GET['stop']) ? abs((int) $_GET['stop']) : false; switch($_GET['action']) { case 'index': index(); break; case 'stopped': stopped(); break; case 'confess': confess(); break; case 'lawyerup': lawyerup(); break; case 'flee': flee(); break; default: index(); break; } if (!in_array($_GET['action'], array('index','stopped', 'confess', 'lawyerup', 'flee'))) { error("Operation not understood!"); } /*this is the default code from the stock monorail nothing has been changed */ function index() { global $db, $ir,$userid,$h; if($ir['jail'] > 0 || $ir['hospital'] > 0) { print "<br>It is impossible to travel while in jail or while recovering."; $h->endpage(); exit; } if(!$_GET['to']) { echo "Welcome to the Method of Travel for your game. It costs \$1000 for a ticket. Where would you like to travel today? "; $q=$db->query("SELECT `cityname`, `citydesc`, `cityminlevel`, `cityid` FROM `cities` WHERE `cityid` != {$ir['location']} AND `cityminlevel` <= {$ir['level']}"); echo "<table width=75% cellspacing=1 align='center' class='table'> <tr style='background:gray'><th>Name</th><th>Description</th><th>Min Level</th><th></th></tr>"; while($r=$db->fetch_row($q)) { echo "<tr><td>".stripslashes(htmlentities($r['cityname']))."</td> <td>".stripslashes(htmlentities($r['citydesc']))."</td><td>{$r['cityminlevel']}</td> <td><a href='monorail.php?to={$r['cityid']}'>Go</a></td> </tr>"; } echo "</table>"; $db->query("UPDATE users SET travellock=1 WHERE userid=$userid"); } else { $travel = (int) rand(1,2); /* this is the chance of getting caught default is 25%*/ if($ir['travellock'] != 1) { print "You can not travel without first visiting the Portal."; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } if($travel < 3) { if($ir['user_level'] == 2) { echo" {$travel} "; } echo "Stop You have been detained due to your illegal activities Please follow me to the Security Center. <br /><a href='monorail.php?action=stopped'> <br /><br /> SECURITY CENTER</a>"; $db->query("UPDATE users SET travellock=2 WHERE userid=$userid"); $h->endpage(); exit; } if($ir['money'] < 1000) { echo "You do not have enough money."; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } else if($_GET['to'] != $_GET['to']) { echo "Invalid city ID"; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } else { $q=$db->query("SELECT * FROM `cities` WHERE `cityid` = {$_GET['to']} AND `cityminlevel` <= {$ir['level']}"); if(!$db->num_rows($q)) { error("Error, this city either does not exist or you cannot go there."); $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } else { $db->query(sprintf("UPDATE `users` SET `money`=`money`-%d,`location`=%u WHERE `userid`=%d", 1000, $_GET['to'], $userid)); $r=$db->fetch_row($q); echo "Congratulations, you paid \$1000 and travelled to ".stripslashes($r['cityname'])." on the monorail!"; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } } } $h->endpage(); exit; } /* this is where you go once youve been caught to choose your option*/ function stopped() { global $db, $ir,$userid,$h; if($ir['jail'] > 0 || $ir['hospital'] > 0) { print "<br>It is impossible to travel while in jail or while recovering."; $h->endpage(); exit; } if($ir['travellock'] != 2) { print "Why are you at the security center?."; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } $stop = (int) rand(1,1); if($stop == 1) { echo "You have been detained on suspicion of being a terrorist. How do you want to pleade for this crime?<br /><br /> <table border='0'><tr><td><form action='monorail.php?action=confess' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Confess!' /> </form></td><td> <form action='monorail.php?action=lawyerup' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Lawyer Up!' /> </form></td><td> <form action='monorail.php?action=flee' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Run Away!' /> </form></td></tr></table>"; } elseif($stop == 2) { echo " You have been detained on suspecion of drugs trafficking. How do you want to pleade for this crime?<br /><br /> <table border='0'><tr><td><form action='monorail.php?action=confess' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Confess!' /> </form></td><td> <form action='monorail.php?action=lawyerup' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Lawyer Up!' /> </form></td><td> <form action='monorail.php?action=flee' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Run Away!' /> </form></td></tr></table>"; } elseif($stop == 3) { echo " You have been detained on suspecion of smuggling diamonds. How do you want to pleade for this crime?<br /><br /> <table border='0'><tr><td><form action='monorail.php?action=confess' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Confess!' /> </form></td><td> <form action='monorail.php?action=lawyerup' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Lawyer Up!' /> </form></td><td> <form action='monorail.php?action=flee' method='POST'> <input type='hidden' name='Stop' value='".number_format($stop)."' /> <input type='submit' value='Run Away!' /> </form></td></tr></table>"; } $db->query("UPDATE users SET travellock=3 WHERE userid=$userid"); } /*this is where yo confess to 1 of the 3 crimes)*/ function confess() { global $db,$ir,$userid,$h; if($ir['jail'] > 0 || $ir['hospital'] > 0) { print "<br>It is impossible to travel while in jail or while recovering."; $h->endpage(); exit; } if($ir['travellock'] != 3) { print "You have done nothing to confess to."; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } /*This is where you set the jail time*/ $time = abs((int) (rand(75,150))); if($_POST['Stop'] == 1) { echo "For confessing to being a terrorist the courts have sentented you to ".number_format($time)." in jail.<br /><br /><br /> <a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`={$time},`jail_reason`='Confession of Sin' WHERE `userid`={$userid}"); /*You will need to change the itemid if you use the 3 items ive made or if you want to use your own items*/ } elseif($_POST['Stop'] == 2) { echo "For confessing to drugs trafficking the courts have sentented you to ".number_format($time)." in jail.<br /><br /><br /> <a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`={$time},`jail_reason`='Confession of Sin' WHERE `userid`={$userid}"); /*You will need to change the itemid if you use the 3 items ive made or if you want to use your own items*/ } else { echo "For confessing to smuggling diamonds the courts have sentenced you to ".number_format($time)." in jail.<br /><br /><br /> <a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`={$time},`jail_reason`='Confession of Sin' WHERE `userid`={$userid}"); /*You will need to change the itemid if you use the 3 items ive made or if you want to use your own items WE REMOVED THIS SECTION OF CODE SEE EARLIER POSTS TO RETRIEVE IT*/ } $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } /*This is where you go when you lawyer up*/ function lawyerup() { global $db,$ir,$userid,$h; if($ir['jail'] > 0 || $ir['hospital'] > 0) { print "<br>It is impossible to travel while in jail or while recovering."; $h->endpage(); exit; } if($ir['travellock'] != 3) { print "You do not need a lawyer at this time."; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } /*This is where you can set the amount of money you can get as compensation*/ $money = abs((int) (rand(10000,25000))); if($_POST['Stop'] = 1) { echo "You make your call to your very expensive lawyer to get him to help you out, Once there your lawyer is able to get to released free of charge on a technicality and suggests that you sue for wrongful detained and is able to get you \$".number_format($money)." in compensation <br /><br /> <a href='index.php'>Go home </a>"; $db->query(sprintf("UPDATE `users` SET `money`=`money`+%u WHERE `userid`=%d", $money, $userid)); } else if($_POST['Stop'] = 2) { echo "You make your call to your very expensive lawyer to get him to help you out, Once there your lawyer is able to get to released free of charge on a technicality and suggests that you sue for wrongful detained and is able to get you \$".number_format($money)." in compensation <br /><br /> <a href='index.php'>Go home </a> "; $db->query(sprintf("UPDATE `users` SET `money`=`money`+%u WHERE `userid`=%d", $money, $userid)); } else { echo "You make your call to your very expensive lawyer to get him to help you out, Once there your lawyer is able to get to released free of charge on a technicality and suggests that you sue for wrongful detained and is able to get you \$".number_format($money)." in compensation <br /><br /> <a href='index.php'>Go home </a>"; $db->query(sprintf("UPDATE `users` SET `money`=`money`+%u WHERE `userid`=%d", $money, $userid)); } $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } /*This is where you go when you try to flee*/ function flee() { global $db, $ir,$userid,$h; if($ir['jail'] > 0 || $ir['hospital'] > 0) { print "<br>It is impossible to travel while in jail or while recovering."; $h->endpage(); exit; } if($ir['travellock'] != 3) { print "What are you running from?"; $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); $h->endpage(); exit; } /*this is for the success rate for fleeing*/ $flee = abs((int) (rand(1,100))); /*this is for the jail time if caught*/ $jailtime = abs((int) (rand(25,75))); /*this is for the amount of diamonds(crystals or whatever you use)*/ $diamonds = abs((int) (rand(1,10))); if($_POST['Stop'] == 1) { echo "After decideding that you cant spend any more time in jail you atempt to flee from the station.<br> "; if($flee <= 25) { echo "You were able to run away from the station and to lose the goons that were chasing you, on your way out you were able to grab back the bag the diamonds were in when you got home you open the bag and in there is ".number_format($diamonds)." diamond(s) <br /><br /><br /><a href='index.php'>Go home </a>"; } else if($flee > 25) { echo "While running for the door out of nowhere 1 of the guards rugby takes you to the group and the other guards jump on you then when you get up a guard knocks you out and you awake to find yourself in jail for ".number_format($jailtime)." <br /><br /><br /><a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`='{$jailtime}',`jail_reason`='Coward' WHERE `userid`='{$userid}'"); } } elseif($_POST['Stop'] == 2) { echo "After decideding that you can spend any more time in jail you atempt to flee from the station.<br> "; if($flee < 25) { echo "You were able to run away from the station and to lose the goons that were chasing you, on your way out you were able to grab back the bag the diamonds were in when you got home you open the bag and in there is {$diamonds} diamond(s) <br><br><font color='8B0000'>+1 Evil Morality</font><br /><a href='index.php'>Go home </a>"; } else if($flee > 25) { echo "While running for the door out of nowhere 1 of the guards rugby tabkes you to the group and the other guards jump on you then when you get up a guard knocks you out and you awake to find yourself in jail for {$jailtime} <br><br><font color='8B0000'>+1 Evil Morality</font><br /><a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`='{$jailtime}',`jail_reason`='Coward' WHERE `userid`='{$userid}'"); } } elseif($_POST['Stop'] == 3) { echo "After deciding that you can spend any more time in jail you attempt to flee from the station.<br> "; if($flee < 25) { echo "You were able to run away from the station and to lose the goons that were chasing you, on your way out you were able to grab back the bag the diamonds were in when you got home you open the bag and in there is ".number_format($diamonds)." diamond(s) <br><br><font color='8B0000'>+1 Evil Morality</font><br /><a href='index.php'>Go home </a>"; } else if($flee > 25) { echo "While running for the door out of nowhere 1 of the guards rugby tabkes you to the group and the other guards jump on you then when you get up a guard knocks you out and you awake to find yourself in jail for ".number_format($jailtime)." <br><br><font color='8B0000'>+1 Evil Morality</font><br /><a href='index.php'>Go home </a>"; $db->query("UPDATE `users` SET `jail`='{$jailtime}',`jail_reason`='Coward' WHERE `userid`='{$userid}'"); } } $db->query("UPDATE users SET travellock=0 WHERE userid=$userid"); } $h->endpage(); ?> B) The new table column you need to help secure it. You will need to add this to your users table. The code is probaly wrong but I will adjust it if someone tells me what it should be. `travellock` int(11) NOT NULL DEFAULT '0', C) The code for your header to work with the securing. You will need to add this into your header somewhere. (Again it may not be perfect but I will clean the code up if anyone tells me how. if($ir['travellock'] == 2 || $ir['travellock'] == 3) { if($_GET['action'] != 'stopped' && $_GET['action'] != 'flee' && $_GET['action'] != 'confess' && $_GET['action'] != 'lawyer') { $randtime=rand(3,12); $jailtime=$randtime*$ir['level']; $db->query("UPDATE users SET jail=jail+{$jailtime}, travellock=0, jail_reason='Caught by the authorities' WHERE userid={$ir['userid']}"); print "You tried to flee from the Security Center. <br /><br />You should know better than that.<br /><br /><b>You are now on your way to jail.</b><br /><br />"; } } } As Far as I can tell this is now fully functional.
-
This is very similar to the magic 8 ball mod.
-
Ravan's Online Mafia Script V1.2 Mods
The Bonded Game replied to -BRAIDZ-'s topic in Free Modifications
Wow, that is all that came into my head. Just, WOW. Ok I have admitted plenty of times I know squat about coding. (still trying to learn.) I have even admitted I purchased a copy from raven. Heck it was $15 bucks or less. But once I found out it was pirated, did a carp ton of research to verify it, I purchased a legal license for McCodes. I am going to enlighten a few things for people that have been hinting at. If you use stolen code (or images) you can have your site shut down by outsiders. The legal owner can sue you for all the money you made PLUS damages. This means anything you made and you will go into the hole for (depending on venue) up to SEVEN times the profit in damages. It would be a crying shame to make a thousand dollars on your game that is just stolen script, then end up having McCodes sue you and take Eight Grand from you in court. (Not saying mccodes would but they COULD). I do not know if McCodes is still doing it but they were giving a discount off of the price of the McCodes engine based on how much you paid Raven, and you would legally be able to keep running the Raven script. I do not think this kid will be able to get it as he stated it was "given" to him. So basically he in legal speak is the "receiver of stolen goods". I sound harsh and I mean to. This is not playtime. When you put your name on the web, and are trying to accept money, then you are in the real world with real consequences. Yes, you can even go to prison for fraud if the case is sever enough. Before you accept your first pay pal "donation" you have better checked with your local legal offices to make sure you are not going to be in violation of any local ordinances. If your in the US, you better have a Tax ID Number for a business, (free from the IRS), and a business license from your local county. It would be a shame to spend hundreds or even thousands of man hours on your game only to end up in jail for tax evasion or theft or fraud. Now I am going to say something to OP specifically. Seriously dude? What the fish? You basically asked everyone on this website to think what would be good for your game, tell you about it, then give it to you for free, then tell you how to install it. This community is one of the nicest I have seen considering what they will help you with and what they will give you of their valuable time. But, you are really pushing the envelope there. I recommend you find the free modifications threads, look through them and find a very easy mod to start with and install it. Then work your way up to more advanced modules. If/when you get a legal game to run, as the owner you will either want to know how to do the very basics or be ready to pay a professional coder to work with you. Asking for help is one thing, asking them to do it all for you is quite another. -
My Whack at ths. @ timpitts: Not bad. You got the ball rolling. Plus one. @ Tonka: Thank you for the table code. Plus one. @ Magictallguy: Thank you for securing it. Plus one. @ Bineye: Still using your hint of removing multiple quote sets from a single line. Now, for the mod itself, it is wonderful and I have added it. Now fully functional. I had to combine pieces from each of the postings. Below you will find my copy which is working for me and should be fully functional. Although it has one error I am still trying to track down. When you open the CB it does not auto fill in how many crystals the player has out into the deposit box. (it is either blank or the amount already in the bank). However the withdraw box will auto fill in how many are in the bank. Also when depositing crystals it does not update the actual total in CB when making a deposit, but does for withdraw. If anyone fixes let me know and I will update the post. Further this is not my mod nor do I take any credit for it. <?php include (DIRNAME(__FILE__) . "/globals.php"); //Learn to secure your script! //And code properly for that matter -.- //Secured by Magictallguy print "<h3>Crystal Bank</h3>"; if($ir['crystalbank']>-1) { //Addition of the functions below to stop a hidden error. (Use error_reporting(E_ALL); too see what I mean... $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 24999) { print "Congratulations, you bought a crystal bank account for \$25,000! <a href='crystalbank.php' >Start using my account</a>"; $sql = sprintf("UPDATE users SET money = money - %u,crystalbank=0 WHERE (userid = %u)", 25000, $userid); $db->query($sql); } else { die("You do not have enough money to open an account, it costs \$25,000 for an account <a href='explore.php' >Back to town...</a>"); } } else { print "Open a <span class='highlight'>crystal</span> <span class='highlight'>bank</span> account today, just \$25,000! <a href='crystalbank.php?buy'> Yes, sign me up!</a>"; } } function index() { global $db, $ir, $c, $userid, $h; $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 <span class="highlight">crystal</span> //2 crystals echo sprintf("<b>You currently have %s crystal%s in your <span class='highlight'>crystal</span> <span class='highlight'>bank</span>.</b> ", number_format($ir['crystalbank']), $s); echo ("<table width='85%' cellspacing=1 class='table'>"); echo ("<tr>"); echo ("<td width='50%'><b>Deposit <span class='highlight'>crystal</span></b> "); echo ("<form action='crystalbank.php?action=deposit' method='post'>"); echo sprintf("Amount: <input type='text' name='deposit' value='%u' /> ", $ir['crystalbank']); echo ("<input type='submit' value='Deposit' /></form></td>"); echo ("<td width='50%'><b>Withdraw crystals</b> "); echo ("There is no fee on withdrawals.<form action='crystalbank.php?action=withdraw' method='post'>"); echo sprintf("Amount: <input type='text' name='withdraw' value='%u' /> ", $ir['crystalbank']); echo ("<input type='submit' value='Withdraw' /></form></td>"); echo ("</tr>"); echo ("</table>"); } function deposit() { global $db, $ir, $c, $userid, $h; $_POST['deposit'] = (float) $_POST['deposit']; if($_POST['deposit'] > $ir['crystals']) { print "You do not have enough crystals to deposit in the <span class='highlight'>bank</span>."; } else { $gain=$_POST['deposit']-$fee; $ir['crystals']+=$gain; $sql = sprintf("UPDATE users SET crystalbank = crystalbank + %u, crystals = crystals - %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($_POST['deposit']), $userid); //You MUST ALWAYS escape everything,, unless you want hackers to gain access? $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 <span class="highlight">crystal</span> //2 crystals echo sprintf("You hand over %s crystal%s to be deposited, ", number_format($_POST['deposit']), $s); echo sprintf(" is added to your account.<br /> ", number_format($gain)); echo sprintf("<b>You now have %s crystal%s in the <span class='highlight'>bank</span>.</b> ", number_format($ir['crystalbank']), $s); echo ("<a href='crystalbank.php' > <br />Back</a>"); } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw'] = (float) $_POST['withdraw']; if($_POST['withdraw'] > $ir['crystalbank']) { print "You do not have enough crystals to withdraw from the <span class='highlight'>bank</span>."; } else { $gain=$_POST['withdraw']; $ir['crystalbank']-=$gain; $sql = sprintf("UPDATE users SET crystalbank = crystalbank - %u, crystals = crystals + %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($gain), $userid); $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 <span class="highlight">crystal</span> //2 crystals echo ("You ask to withdraw ($gain) crystals, <br />"); echo ("the banking lady grudgingly hands it over.<br /> "); echo sprintf("<b>You now have %s crystal%s in the <span class='highlight'>bank</span>.</b> ", ($ir['crystalbank']), $s); echo ("<a href=crystalbank.php> <br /> Back</a>"); } } $h->endpage(); ?>
-
Ok a lot of discussion has come down to this being able to install it. I stated that I could not get it to install. This was not a user error. This was a coding error. I bought the Raven script first. (yes i now know it was stolen.) I installed it on the first try with no problems and just a tad bit of help from Lillith. When I learned of the piracy issues, I bought my McCodes version. When I tried to install it would not work. That is what I am referring to. As I have had mine up and going for over a year now, I have learned a lot. I looked back over my original post. I stand by all of them. Yes I have figured out how to do all of them (except the templates, but soon enough on that one), but it has been a long process. Specifically to the comment of if you cant code you have no business owning a game. Pure rubbish. Stephen King has horrible grammar skills yet is a profitable writer. I doubt the CEO of Ford could tell you the specs of every engine that comes off the assembly line. This does not disqualify them. King has editors, and Ford has mechanics/ engineers to help them. I hire coders to help get the idea from my head to the screens of the players, they are my editor or mechanics. I am sure other people are the same way, they have an idea and want to try to get it out there. I will grant that most of them have no clue what they are doing, (including me). However, I already own one business. Most of the same principles apply. One good idea, mixed with one heck of a lot of work. Am I learning how to code as I go along? YES, I am. But trying to make it a little easier is not a bad idea.
-
I love this and plan on adding it, is there a way to make it city specific?
-
Adding stats into a Streets Mod.
The Bonded Game replied to The Bonded Game's topic in Modification Support
Sorry Bineye, Yours worked perfectly!! I appreciate your help! -
Adding stats into a Streets Mod.
The Bonded Game replied to The Bonded Game's topic in Modification Support
Try copying that. Should work ok. Sorry yours did not work though. Thank you bineye!!! Plus one for you!! -
Adding stats into a Streets Mod.
The Bonded Game replied to The Bonded Game's topic in Modification Support
if ($chance == 16) { $gained=rand(2,9)*$ir['level']; $db->query('UPDATE `userstats` SET `strength'=strength + $gained'); print "While , you come across an old tree. Using your might, you knock it down gaining <b>/$gained strength.</b>; "; } adjusted it now getting this error... Parse error: syntax error, unexpected '=' in /home/thebo41/public_html/street.php on line 106 So I still have some sort of error in the code string. -
Greetings, I am starting for the first time a thread. I am sure this is basic knowledge but I have, as yet, been unable to discover where it is hidden away. I would like to add a random amount of stats for my players as they do there steps in the streets mod. This would be chance 16 of quite a bit. if ($chance == 16) { $gained=rand(2,9)*$ir['level']; print "While , you come across an old tree. Using your might, you knock it down gaining <b>/$gained strength.</b>; $db->query('UPDATE `userstats` SET `strength'=strength + $gained'); "; } Ok, here is the out put from doing this step... While , you come across an old tree. Using your might, you knock it down gaining /300 strength.; ('UPDATE `userstats` SET `strength'=strength + 300'); Obviously it should not look like that. It is also not adding the strength to the player stats. Any help on this would be much appreciated. Although I would like to know what this particular piece of code is, I plan on adding this in to a lot of steps for different stats and hope that a simple generic code string would work. I appreciate your time.