Jump to content
MakeWebGames

shaved92bravada

Members
  • Posts

    234
  • Joined

  • Last visited

Everything posted by shaved92bravada

  1. Re: [mccode v2] Fishing Mod You could add boat, lure, pole, etc into the users table in the database couldn't you or are you wanting to do it a deifferent way??
  2. Re: [mccode v2] Golden Snitch this is what i was talking about when I said make it random. This is untested but should work. replace   if($_GET['spend'] == '100000000') { if($ir['money'] <1000000) { print "You Either Dont Have The Money Or Energy Or Speed!"; } else { $cashwon=rand(100000,10000000); $db->query("UPDATE users SET money=money+ { $cashwon } ,crystal=crystal+5 WHERE userid=$userid",$c); $db->query("UPDATE users SET money=money-1000000 WHERE userid=$userid",$c); print "<center>You Look For The Snitch You Catch It Successfully , Congratulatiions You Gain 5 CRYSTAL - Also Got {$cashwon} Cash <a /> href='index.php'>>Home</a></center>"; } }   with this   if($_GET['spend'] == '100000000') { if($ir['money'] <1000000) { print "You Either Dont Have The Money Or Energy Or Speed!"; } else { $snitch = rand(1,100); $chance = 30; // This changes the percent chance of a successful find. Right now it is 30%. Higher will give you a better success rate $cashwon=rand(100000,10000000); if($snitch <= $chance) { $db->query("UPDATE users SET money=money+ { $cashwon } ,crystal=crystal+5 WHERE userid=$userid",$c); $db->query("UPDATE users SET money=money-1000000 WHERE userid=$userid",$c); print "<center>You Look For The Snitch You Catch It Successfully , Congratulatiions You Gain 5 CRYSTAL - Also Got {$cashwon} Cash <a /> href='index.php'>>Home</a></center>"; } else $db->query("UPDATE users SET money=money-1000000 WHERE userid=$userid",$c); print " Sorry no luck on catching the golden snitch this go around! [url='index.php']Go Home[/url]"; } } } ?>   That way you don't find the snitch every single time. The way it is set there you have a 30% chance of catching it. You can make that number higher say 80 then it would be an 80% chance. which would be better.
  3. Re: [mccode v2] Golden Snitch from what I have read of the script you get get money everytime?? Why not make it random?? and why name it mine.php instead of snitch.php?? lol But other than that good for a first mod.
  4. Re: [McCode V2] Request in global_func.php find   $db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid");   that is where you can change the amount of brave when they level up.
  5. Re: [mccode] Jail Key Try this, its untested but it should work.   <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['rubies'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $_GET['ID'] = abs((int) $_GET['ID']); //Food if(!$_GET['ID']) { print "Invalid use of file"; } else { $i=mysql_query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid",$c); if(mysql_num_rows($i) == 0) { print "Invalid item ID"; } else { $r=mysql_fetch_array($i); if($r['itmtypename'] == 'Food') { $f=mysql_query("SELECT * FROM food WHERE item_id={$r['itmid']}",$c); $fr=mysql_fetch_array($f); mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['ID']}",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); mysql_query("UPDATE users SET energy=energy+{$fr['energy']} WHERE userid=$userid"); mysql_query("UPDATE users SET energy=maxenergy WHERE energy > maxenergy"); print "You cram a {$r['itmname']} into your mouth. You feel a bit of energy coming back to you."; } else if($r['itmtypename'] == 'Medical') { $f=mysql_query("SELECT * FROM medical WHERE item_id={$r['itmid']}",$c); $fr=mysql_fetch_array($f); mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['ID']}",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); mysql_query("UPDATE users SET hp=hp+{$fr['health']} WHERE userid=$userid"); mysql_query("UPDATE users SET hp=maxhp WHERE hp > maxhp"); print "You spray a {$r['itmname']} into your mouth. You feel a bit of health coming back to you."; } if($r['itmname'] == 'Full Restore') { mysql_query("UPDATE users SET energy=maxenergy,will=maxwill,brave=maxbrave, hp=maxhp WHERE userid=$userid",$c); } if($r['itmname'] == 'Will Potion') { mysql_query("UPDATE users SET will=maxwill WHERE userid=$userid",$c); } print "You used a {$r['itmname']} and feel much better."; } if($r['itmname'] == 'Jail Key') { mysql_query("UPDATE users SET jailtime=jailtime-6 WHERE userid=$userid",$c); mysql_query("UPDATE users SET jailtime=0 WHERE jailtime < 0"); print "You use a {$r['itmname']} and take 6 minutes off your sentence!!"; } else { print "You cannot use this item."; } } $h->endpage(); ?>
  6. Re: [mccode V2] Very simple travel time mod. well I can't really sell it because its won't pass valid xhtml or css. Plus I am just tryin to beat " the man " lol us little guys out here just tryin to make a name for ourselves. Besides I have gotten so much free stuff from the community that its time for me to give back to the community and once I found out I had a knack in making some decent logins and templates and such I figured I would make some of those. Can't believe I actually made a full mod that works lol. If ya'll have more ideas I would be glad to give em a try.
  7. Re: [mccode V2] Very simple travel time mod. yeah that layout is pretty tricky lol. I am actually thinking of going back to a two column and posting this one on here with psd files and everything if anyone is interested in it. Oh and if you wanna see the layout in action you can check out my login pages as well as all the other links on it. I just have my registrations disabled right now. www.bravenations.com
  8. Re: [mccode V2] Very simple travel time mod. Ok I think I got all the kinks worked out of the travel time/travel select mod. The coding may not be the greatest or most secure but if you want to use it use it. If you have any questions on what to do then let me know and I will do my best to answer them. I pretty much did all this from scrath although I used bits and pieces of the monorail.php. I will include the images I used with the travel select but feel free to find your own if you want to. You must have already done the previous time travel mod for this to work correctly. Screenshots save this as travel.php <?php /** * Made By Shaved92Bravada * Made for the CE Community as a free mod * This is not to be sold. * @copyright 2008 */ include "globals.php"; include "travellingglobals.php"; switch($_GET['action']) { case "pickcity": pickcity(); break; case "travel": travel(); break; default: index(); break; } function index() { global $db, $ir, $c, $h, $set, $userid; $traveltype=abs((int) $_POST['traveltype']); echo '<big>Welcome to the '.$set['game_name'].' Travel Center. How would you like to travel today?</big> <table width="90%" class="table"><tr><th colspan="3">Choose your preferred method of travel from the options below. Please be aware that different modes of travel have different costs and the travel times will vary.</th></tr> <th>Plane</th><th>Train</th><th>Automobile</th> <tr> <td><image src="/images/jet.jpg" width="180" height="150"></td> <td><image src="/images/train.jpg" width="180" height="150"></td> <td><image src="/images/car.jpg" width="180" height="150"></td> </tr> <tr><form action="travel.php?action=pickcity" method="post"> <td><input type="radio" name="traveltype" value="Plane" /> Travel By Plane </td> <td><input type="radio" name="traveltype" value="Train" /> Travel By Train </td> <td><input type="radio" name="traveltype" value="Automobile" /> Travel By Automobile </td> </tr> <tr><td colspan="3"><input type="submit" value="Pick City" /> </table>'; $h->endpage(); } function pickcity() { global $db, $ir, $c, $h, $userid; if(!$_POST['traveltype']) { echo 'You must choose a travel type. <a href=travel.php>> Back</a>'; $h->endpage(); exit; } else if(!$_GET['to']) { $q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']}"); $r=$db->fetch_row($q); $cost=3000; $type=($_POST['traveltype']); if ($_POST['traveltype'] == Plane) { $rantime=($r['citytravtime']); $cost=$cost*8; $go=fly; //since the travel type is by plane then the cost would be higher but the travel time would be less significant. } else if ($_POST['traveltype'] == Train) { $rantime=($r['citytravtime']*2); $cost=$cost*5; $go=ride; //since the travel type is by train then the cost would be less but the travel time would be a little longer. } else if ($_POST['traveltype'] == Automobile) { $rantime=($r['citytravtime']*4); $cost=$cost; $go=drive; //since the travel type is by car then the cost would be normal cost but the travel time would be even greater than the other types. } $q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}"); echo ' <h3>You have chosen to travel by '.$type.'. It is going to cost you $'.$cost.'. Where would you like to '.$go.' today?</h3> <table width="90%" cellspacing="1" class="table"><tr><th>City</th><th>Description</th><th>Min Level</th><th>Travel Time</th><th>Travel</th></tr>'; while($r=$db->fetch_row($q)) { echo ' <tr> <td>'.$r['cityname'].'</td> <td>'.$r['citydesc'].'</td> <td>'.$r['cityminlevel'].'</td> <td>'.$rantime.' Min</td> <td>[url="travel.php?action=travel&to='.$r['cityid'].'&type='.$type.'"]Go[/url]</td></tr>'; } echo '</table>'; } } function travel() { global $db, $ir, $c, $h, $userid; $_GET['to'] = abs((int) $_GET['to']); if($ir['money'] < $cost) { echo 'Ummmmmmmmmmmmm, You dont have enough money.'; $h->endpage(); exit; } else if( ((int) $_GET['to']) != $_GET['to']) { echo 'Just where in the hell are you trying to go??'; $h->endpage(); exit; } else { $q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}"); if(!$db->num_rows($q)) { echo 'Either the city you selected does not exist or you cannot go there. Do pass go do not collect $200.....'; $h->endpage(); exit; } else { $r=$db->fetch_row($q); $cost=3000; $type=($_GET['type']); if ($_GET['type'] == Plane) { $rantime=($r['citytravtime']); $tcost=$cost*8; //since the travel type is by plane then the cost would be higher but the travel time would be less significant. } else if ($_GET['type'] == Train) { $rantime=($r['citytravtime']*2); $tcost=$cost*5; //since the travel type is by train then the cost would be less but the travel time would be a little longer. } else if ($_GET['type'] == Automobile) { $rantime=($r['citytravtime']*4); $tcost=$cost; //since the travel type is by car then the cost would be normal cost but the travel time would be even greater than the other types. } $db->query("UPDATE users SET money=money-$tcost,location={$_GET['to']}, traveltime=$rantime WHERE userid=$userid"); echo 'Congratulations, you paid '.$tcost.' and are now travelling to '.$r['cityname'].'! It will take '.$rantime.' minutes to arrive.'; } } } $h->endpage(); ?> and replace your link [url='monorail.php']Travel Agency[/url] with <a href=travel.php'>Travel Center</a> Also note this is for V2 so if you want to convert it to V1 then feel free to do so. Save the to your images folder. train.jpg jet.jpg car.jpg
  9. Re: [mccode V2] Very simple travel time mod. As promised I am working on choosing different modes of travel, I warn you now it probably won't be the best looking code or most secure but hey its free and its something to work off of. So here is a screenshot of what I have so far, I am going to keep working on this tonight and see if I can get it done. Like I said its free so if you don't like it or like the way I code then you don't have to use it once I get it done lol. Also I am looking for some ideas on this as to what traveltimes and such should be. I am thinking of simplifying it by making the travel type into a number and doing something like if ($_POST['traveltype'] == 1) { $rantime=($r['citytravtime']); $cost=$cost*8; //since the travel type is by plane then the cost would be higher but the travel time would be less significant. } else if ($_POST['traveltype'] == 2) { $rantime=($r['citytravtime']*2); $cost=$cost*5; //since the travel type is by train then the cost would be less but the travel time would be a little longer. } else if ($_POST['traveltype'] == 3) { $rantime=($r['citytravtime']*4); $cost=$cost; //since the travel type is by car then the cost would be normal cost but the travel time would be even greater than the other types. } I am pretty sure something along those lines would work but not completely sure, I don't even know if I am going to use _POST or _GET yet I think _GET would be better but we will see what I can get to work. Like I said any ideas or input on this would be greatly appreciated.
  10. Re: [mccode v1] DONATION PACKS TO ITEMS   First of all I must say that you are still using the donatordone.php to credit the user??? If so I must say that is a bad idea, I found that out real quickly, if I were you I would read up on the forums and use the ipn file. Works great. I made this to work with V2 and if I get some extra time I will see what I can do about making it work on V1 if ya'll still need it, I don't mind its just finding the time. Actually its alot easier to work with on V1 if I remember correctly lol.
  11. Re: [mccode V2] Very simple travel time mod. I got it figured out now. It was a damn idiot error. lol this should work properly for the monorail.php replace it with this one.   <?php include "globals.php"; include "travellingglobals.php"; $cost= 2000; $_GET['to'] = abs((int) $_GET['to']); if(!$_GET['to']) { print "<big>Welcome to the {$set['game_name']} station. It costs \$$cost for a ticket. Where would you like to travel today?</big> "; $q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}"); print "<table width=90% cellspacing=1 class='table'><tr><th>Name</th><th>Description</th><th>Min Level</th><th>Travel Time</th><th>Travel</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>{$r['cityname']}</td><td>{$r['citydesc']}</td><td>{$r['cityminlevel']}</td><td>{$r['citytravtime']}</td><td>[url='monorail.php?to={$r[']Go[/url]</td></tr>"; } print "</table>"; } else { if($ir['money'] < $cost) { print "Ummmmmmmmmmmmm, You don't have enough money."; $h->endpage(); exit; } else if( ((int) $_GET['to']) != $_GET['to']) { print "Just where in the hell are you trying to go??"; $h->endpage(); exit; } else { $q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']} "); if(!$db->num_rows($q)) { print "Either the city you selected does not exist or you cannot go there. Do pass go do not collect \$200....."; $h->endpage(); exit; } else { $r=$db->fetch_row($q); $rantime=($r['citytravtime']); $db->query("UPDATE users SET money=money-$cost,location={$_GET['to']}, traveltime=$rantime WHERE userid=$userid"); print "Congratulations, you paid \$$cost and are now travelling to {$r['cityname']} on the subway! It will take $rantime minutes to arrive."; } } } $h->endpage(); ?>   and here is the correct function for the staff_cities.php as well. I can't remember if the other one worked correctly or not.   function addcity() { global $db, $ir, $c, $h, $userid; $travtime=abs((int) $_POST['travtime']); $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; if($minlevel and $desc and $name) { $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}'"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $db->query("INSERT INTO cities VALUES(NULL, '$name', '$desc', '$minlevel', '$travtime')"); print "City {$name} added to the game."; stafflog_add("Created City $name"); } else { print "<h3>Add City</h3><hr /> <form action='staff_cities.php?action=addcity' method='post'> Name: <input type='text' name='name' /> Description: <input type='text' name='desc' /> Minimum Level: <input type='text' name='minlevel' /> Travel Time: <input type='text' name='travtime' /> <input type='submit' value='Add City' /></form>"; } } function editcity() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $travtime=abs((int) $_POST['travtime']); $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}' AND cityid!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['id']}"); $old=$db->fetch_row($q); $db->query("UPDATE cities SET citytravtime=$travtime, cityminlevel=$minlevel, citydesc='$desc', cityname='$name' WHERE cityid={$_POST['id']}"); print "City $name was edited successfully."; stafflog_add("Edited city $name"); break; case "1": $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['city']}"); $old=$db->fetch_row($q); print "<h3>Editing a City</h3><hr /> <form action='staff_cities.php?action=editcity' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['city']}' /> Name: <input type='text' name='name' value='{$old['cityname']}' /> Description: <input type='text' name='desc' value='{$old['citydesc']}' /> Minimum Level: <input type='text' name='minlevel' value='{$old['cityminlevel']}' /> Travel Time: <input type='text' name='travtime' value='{$old['citytravtime']}' /> <input type='submit' value='Edit City' /></form>"; break; default:   I will also work on adding in different modes of travel as well if someone will post what types of travel they use in their game or would like to use. I know of planes, trains, and automobiles and I don't mean the movie. lol If that are the main three then I will start working on that at once.
  12. Re: [mccode V2] Very simple travel time mod. Well the problem is its not showing up the traveltime. I just can't figure out for the life of me why.   QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE userid=1' at line 1 Query was UPDATE users SET money=money-2000,location=4, traveltime= WHERE userid=1   That is the error and here is the code which is also on the 1st page.   <?php include "globals.php"; include "travellingglobals.php"; $cost= 2000; $_GET['to'] = abs((int) $_GET['to']); if(!$_GET['to']) { print "<big>Welcome to the {$set['game_name']} station. It costs \$$cost for a ticket. Where would you like to travel today?</big> "; $q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}"); print "<table width=90% cellspacing=1 class='table'><tr><th>Name</th><th>Description</th><th>Min Level</th><th>Travel Time</th><th>Travel</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>{$r['cityname']}</td><td>{$r['citydesc']}</td><td>{$r['cityminlevel']}</td><td>{$r['citytravtime']}</td><td>[url='monorail.php?to={$r[']Go[/url]</td></tr>"; } print "</table>"; } else { if($ir['money'] < $cost) { print "Ummmmmmmmmmmmm, You don't have enough money."; $h->endpage(); exit; } else if( ((int) $_GET['to']) != $_GET['to']) { print "Just where in the hell are you trying to go??"; $h->endpage(); exit; } else { $q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']} "); if(!$db->num_rows($q)) { print "Either the city you selected does not exist or you cannot go there. Do pass go do not collect \$200....."; $h->endpage(); exit; } else { $rantime=$r['citytravtime']; $db->query("UPDATE users SET money=money-$cost,location={$_GET['to']}, traveltime=$rantime WHERE userid=$userid"); $r=$db->fetch_row($q); print "Congratulations, you paid \$$cost and are now travelling to {$r['cityname']} on the subway! It will take $rantime minutes to arrive."; } } } $h->endpage(); ?>
  13. Re: [mccode V2] Very simple travel time mod. I am still looking at it trying to figure out what is causing it. I will continue to work on it till I get it fixed. I will post it here once I am positive that it works.
  14. Re: [MOD all MCC's] LET IT SNOW   You can set the amount of flakes falling... lol yeah I saw that just hadn't gotten around to it. I also found one with leaves falling. Pretty awesome stuff, looks like I need to spread my learnin to some javascript as well.
  15. Re: My first Login Thats what I meant, thanks for the insite MD
  16. Re: My first Login thanks for the info MD lol.
  17. Re: My first Login   thats quite a bit larger than a thumbnail, lol I know how to do the whole img][/img code tags.
  18. Re: [MOD all MCC's] LET IT SNOW that is awesome just needs a bit more flakes fallin lol.
  19. Re: [MOD all MCC's] LET IT SNOW thanks for the suggestion I will have to look into it some more before it gets to christmas time.
  20. Re: [MOD all MCC's] LET IT SNOW sounds like an awesome mod for christmas I agree, I tried it out, not sure if I added it wrong or something but it was just in one line straight down lol. I will work on it more and figure out what I am doing wrong lol.
  21. Re: My first Login screenshot of it for everyone http://i3.photobucket.com/albums/y63/re ... screen.jpg dammit I gotta figure out how to have a thumbnail that you can click on lol
  22. Re: [MOD Mcc V1 + V2] A better Safer Forum for your members to enjoy yeah I would definately keep it in seperate databases. I used a forum at one point in time that you could merge the usernames/passwords from your existing db into it, I just can't remember which one it was. but yeah I could make it where something like if (!$ir['forumreg']) it sends them to the register page for the forums. or puts a reminder at the top of the page something along those lines.
  23. Re: [mccode] Multi IP Prevention this is what I use for multi IP's. Like they say you can't stop them if they really want another account but hey it slowed em down for me lol   $q=$db->query("SELECT * FROM users WHERE lastip='$IP' AND userid={$_POST['ref']}"); $a=$db->query("SELECT * FROM users WHERE lastip='$IP'",$c); if($db->num_rows($a) > 0) { die("No multi's! Your not trying to make another account are you! Sorry! Not Allowed!"); } if($db->num_rows($q)) { die("No creating referral multies. >[url='register.php']Back[/url]"); }
  24. Re: [MOD Mcc V1 + V2] A better Safer Forum for your members to enjoy yeah true. But to my advantage I am the only one that is registered on my game right now lol. So if I can figure out how to make it when they register for the game it also inserts the required info into the smf database then all is well lol. But that will be later.
  25. Re: [Other] Disable Register(not technicaly disabled) well like right now my game is just alpha, and I am the only one registered, but just in case someone stumbles upon my game they can't register. And when I want someone to register and test some things out then I can just go in the staff panel and open registrations. Thats the reason why I did that. lol but yeah I see what your saying as well.
×
×
  • Create New...