Jump to content
MakeWebGames

shaved92bravada

Members
  • Posts

    234
  • Joined

  • Last visited

Everything posted by shaved92bravada

  1. Re: [MOD Mcc V1 + V2] A better Safer Forum for your members to enjoy that is pretty awesome illusions. I am prolly gonna use this. Seems to be a bit safer that using the mccodes forums since they are pretty exploitable. Now I just gotta figure out if I can figure out how to sync my users login/password with the smf so that they don't have to signup for them as well. Plus find the right theme to make it work with my game lol.
  2. Re: [Other] Disable Register(not technicaly disabled)     Actually i gotta agree with you would be a lot easier just rename the register and make another that says GO AWAY come back when im done ;) lol I guess its just me but it seems to me that it would be easier to edit one time than it would be to go in and edit the link whenever you needed to disable registrations. But not putting anyone down or anything as its a matter of opinion lol.
  3. Re: [Other] Disable Register(not technicaly disabled) then you have to go in and edit it each time you want to do something rather than doing just the one time edit that I have posted and if you need to disable registration it can be done directly from the staff panel. Tell me that is not convenient. lol Not saying these other ways wouldn't work as well just seems to me that it would be more efficient to be able to enable or disable from in game.
  4. Re: [Other] Disable Register(not technicaly disabled) lol thats the same thing that I was thinking. I just wasn't gonna say nothing. I think the one I posted works very well, and is convenient that you can turn it on or off in the staff panel. If you want to see it working go to www.bravenations.com/register.php
  5. Re: Need help with an incentive reward script TOPRPG, MPOGR, PBBG WARP those are the three I am using that I know have incentive reward script support. I got the sample script from PBBG.
  6. I was trying to make my own reward script that the voting sites could send a responce to in which that would be the only way the player would be rewarded is if they actually voted and the voting site sent their responce to my script. Well I made one and ran it manually, worked great but will not work with the voting sites that support incentive scripts, so I found an example of a reward script off of one of the voting sites and am trying to edit it to make it work correctly but so far to no avale. I will also add that I am not the greatest with programming, I am just trying to learn it on my own with help from the forums as well as other known and often posted sites lol. Anyway any help or suggestions would be greatly appreciated. here is what I have so far. Oh and I am using V2 as you can tell by the include "globals.php"; in my version of it. Thank you in advance for your contructive critisism or suggestions in advance. The original example script.   <? // Set content type header('Content-type: text/xml'); // Check input if (!isset($_GET['success']) || !isset($_GET['userid'])) { echo '<response rewarded="0" message="Invalid input." />'; die(); } // Get data $success = $_GET['success']; $userID = $_GET['userid']; // Has this user already claimed a reward today? $alreadyRewarded = false; if ($alreadyRewarded) { echo '<response rewarded="0" message="You have already claimed a reward today." />'; die(); } // Credit reward if ($success == 1) { // Give large reward here echo '<response rewarded="1" message="Large reward given for your successful vote." />'; die(); } else { // Give small reward (or no reward) here echo '<response rewarded="1" message="Small reward given for your attempted vote." />'; die(); } ?>   And after I added in a few things it needed and some I thought it needed. lol   <? // Set content type header('Content-type: text/xml'); include "globals.php"; // Check input if (!isset($_GET['success']) || !isset($_GET['userid'])) { echo '<response rewarded="0" message="Invalid input." />'; die(); } // Get data $success = $_GET['success']; $userID = $_GET['userid']; $q=$db->query("SELECT * FROM users WHERE userid = $userID"); while($r=$db->fetch_row($q)) // Has this user already claimed a reward today? if ($r['rewarded']=1) { echo '<response rewarded="0" message="You have already claimed a reward today." />'; die(); } // Credit reward if ($success == 1) { $db->query("UPDATE users SET crystals=crystals+10, rewarded=1 WHERE userid=$userID"); // Give large reward here event_add($userID, "For actually voting you have recieved 10 Crystals.", $c); echo '<response rewarded="1" message="Large reward given for your successful vote." />'; die(); } else if ($success == 0) { // Give small reward (or no reward) here event_add($userID, "Thanks for trying to vote but it didn't count.", $c); echo '<response rewarded="1" message="Thanks for your attempted vote." />'; die(); } ?>
  7. Re: [mccode V2] Very simple travel time mod. it was ok, its all a matter of opinion I just don't see the need in using it. lol
  8. Re: [mccode V2] Very simple travel time mod. hmmmm I figured it would work, I'm not sure what is causing that it looked like it would work lol. Not sure there, I will look into it some more and see if I can figure out what the problem is.
  9. Re: [mccode V2] Very simple travel time mod. yeah you can set the prices to whatever you want them to be. just by going through your staff panel.
  10. Re: two problems...#1 "crons" #2"basic settings" hmmmmmm what are you trying to update on your settings?
  11. Re: two problems...#1 "crons" #2"basic settings" sounds like it could be in your config.php possibly, you might take a look at that.
  12. Re: [Other] Disable Register(not technicaly disabled) thats what mine does that I posted and you are able to do it all from the staff panel. once you turn the registrations off in the staff panel then it removes the submit button and replaces it with a message saying "REGISTRATIONS ARE TEMPORARILY DOWN PLEASE TRY AGAIN LATER"
  13. Re: [Other] Disable Register(not technicaly disabled) or you could do something along these lines. make a new entry in your settings table (`conf_id`, `conf_name`, `conf_value`) VALUES ('18', 'reg_off, '0'); those are the values you need to put in there. If you need help with that lemme know then open up your register.php find   if($set['regcap_on']) { print "<tr> <td colspan=3>[img=captcha_verify.php?bgcolor=C3C3C3] <input type='text' name='captcha' /></td> </tr>"; } print " <tr> <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form> > [url='login.php']Go Back[/url]"; }   and replace with this   if($set['regcap_on']) { print "<tr> <td colspan=3>[img=captcha_verify.php?bgcolor=C3C3C3] <input type='text' name='captcha' /></td> </tr>"; } if(!$set['reg_off']) { print "<tr> <td colspan=3 align=center>[b]<FONT COLOR=RED>REGISTRATIONS ARE TEMPORARILY DOWN TRY AGAIN LATER</FONT>[/b]</td> </tr> </table> </form> > [url='login.php']Go Back[/url]"; } ELSE print " <tr> <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form> > [url='login.php']Go Back[/url]"; }   then open staff.php find   print "</select> Registration CAPTCHA: <select name='regcap_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['regcap_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select>   put this right after   Registration: <select name='reg_off' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['reg_off']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select>   That will allow you to turn off registrations from your staff panel pretty much all it does is disable the submit button they can still type in all of the information and such, I'm sure there is a way around that but hey its simple and it works for me.
  14. Re: [mccode V2] Very simple travel time mod. your using V1 so you would need to add the information into your admin panel. I would do it for you but I really don't have the time as I am working on my itemuse.php so everything will work correctly with some of my new special items I made. lol. plus its really simple to add those things in there.
  15. Re: [mccode V2] Very simple travel time mod. ok well in that case then this should work perfectly if you want a dedicated traveltime for each city on the monorail.php And you will also need the travellingglobals, etc from my first post. I just like having random times and things like that. Alot of other things are random on my game, like the cost to travel is also random. Why not make it like the real world where things change ya know. SQL   ALTER TABLE `cities` ADD `citytravtime` INT(11) NOT NULL DEFAULT '0';   replace your monorail.php 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 { $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(); ?>   replace your staff_cities.php with this   <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains city stuffs switch($_GET['action']) { case "addcity": addcity(); break; case "editcity": editcity(); break; case "delcity": delcity(); break; default: print "Error: This script requires an action."; break; } function addcity() { global $db, $ir, $c, $h, $userid; $minlevel=abs((int) $_POST['minlevel']); $travetime=abs((int) $_POST['travtime']); $name=$_POST['name']; $desc=$_POST['desc']; if($minlevel and $desc and $name and $travtime) { $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": $minlevel=abs((int) $_POST['minlevel']); $travetime=abs((int) $_POST['travtime']); $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 cityminlevel=$minlevel, citytravtime=$travtime, 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: print "<h3>Editing a City</h3><hr /> <form action='staff_cities.php?action=editcity' method='post'> <input type='hidden' name='step' value='1' /> City: ".location_dropdown($c, "city")." <input type='submit' value='Edit City' /></form>"; break; } } function delcity() { global $db,$ir,$c,$h,$userid; if($_POST['city']) { $q=$db->query("SELECT * FROM cities WHERE cityid={$_POST['city']}"); $old=$db->fetch_row($q); if($old['cityid']==1) { die("This city cannot be deleted."); } $db->query("UPDATE users SET location=1 WHERE location={$old['cityid']}"); $db->query("UPDATE shops SET shopLOCATION=1 WHERE shopLOCATION={$old['cityid']}"); $db->query("DELETE FROM cities WHERE cityid={$old['cityid']}"); print "City {$old['cityname']} deleted."; stafflog_add("Deleted city {$old['cityname']}"); } else { print "<h3>Delete City</h3><hr /> Deleting a city is permanent - be sure. Any users and shops that are currently in the city you delete will be moved to the default city (ID 1).<form action='staff_cities.php?action=delcity' method='post'> City: ".location_dropdown($c, "city")." <input type='submit' value='Delete City' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?>   I haven't tested that but it should work properly. Someone can feel free to try it out.
  16. Re: [mccodes v2] Tournement PvP [$10.00]  
  17. Re: [mccode v2] Honor Awards - Modified by HarryB And the rest of it.   $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes2000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes2000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 2000 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c2500'){ if ($ir['crimesdone'] <2500) { echo "You need to have done 2500 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes2500'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes2500')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 2500 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c5000'){ if ($ir['crimesdone'] <5000) { echo "You need to have done 5000 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes5000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes5000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 5000 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='5mill'){ if (($ir['money']+$ir['bankmoney']) <5000000) { echo "You need to have 5 million in your bank and/or onhand to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='5mill'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'5mill')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having collected 5 million. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='10mill'){ if (($ir['money']+$ir['bankmoney']) <10000000) { echo "You need to have 10 million in your bank and/or onhand to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='10mill'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'10mill')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having collected 10 million. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='20mill'){ if (($ir['money']+$ir['bankmoney']) <20000000) { echo "You need to have 20 million in your bank and/or onhand to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='20mill'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'20mill')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having collected 20 million. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='50mill'){ if (($ir['money']+$ir['bankmoney']) <50000000) { echo "You need to have 50 million in your bank and/or onhand to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='50mill'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'50mill')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having collected 50 million. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='100mill'){ if (($ir['money']+$ir['bankmoney']) <100000000) { echo "You need to have 100 million in your bank and/or onhand to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='100mill'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'100mill')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having collected 100 million. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='g100'){ if ($ir['daysingang'] <100) { echo "You need to have been in a gang for 100 days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='g100'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'g100')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having been in a gang for 100 days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='g200'){ if ($ir['daysingang'] <200) { echo "You need to have been in a gang for 200 days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='g200'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'g200')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having been in a gang for 200 days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='g300'){ if ($ir['daysingang'] <300) { echo "You need to have been in a gang for 300 days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='g300'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'g300')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having been in a gang for 300 days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='g400'){ if ($ir['daysingang'] <400) { echo "You need to have been in a gang for 400 days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='g400'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'g400')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having been in a gang for 400 days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='g500'){ if ($ir['daysingang'] <500) { echo "You need to have been in a gang for 500 days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='g500'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'g500')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having been in a gang for 500 days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='d150'){ if ($ir['donatordays'] <150) { echo "You need to have 150 donator days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='d150'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'d150')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 150 donator days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='d200'){ if ($ir['donatordays'] <200) { echo "You need to have 200 donator days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='d200'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'d200')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 200 donator days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='d300'){ if ($ir['donatordays'] <300) { echo "You need to have 300 donator days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='d300'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'d300')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 300 donator days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='d400'){ if ($ir['donatordays'] <400) { echo "You need to have 400 donator days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='d400'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'d400')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 400 donator days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='d500'){ if ($ir['donatordays'] <500) { echo "You need to have 500 donator days to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='d500'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'d500')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 500 donator days. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='cr2000'){ if ($ir['crystals'] < 2000) { echo "You need to have 2000 Crystals to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='cr2000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'cr2000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 2000 Crystals. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='cr5000'){ if ($ir['crystals'] < 5000) { echo "You need to have 5000 Crystals to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='cr5000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'cr5000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 5000 Crystals. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='cr10000'){ if ($ir['crystals'] < 10000) { echo "You need to have 10000 Crystals to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='cr10000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'cr10000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 10000 Crystals. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='cr20000'){ if ($ir['crystals'] < 20000) { echo "You need to have 20000 Crystals to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='cr20000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'cr20000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 20000 Crystals. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='cr50000'){ if ($ir['crystals'] < 50000) { echo "You need to have 50000 Crystals to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='cr50000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'cr50000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on having at least 50000 Crystals. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } $h->endpage(); ?>
  18. Re: [mccode v2] Honor Awards - Modified by HarryB me personally I think this looks better and I added in crystal honor awards as well.   <?php include_once(DIRNAME(__FILE__) . '/globals.php'); if (!isset($_GET['action'])){ print "<h3>Honor Awards</h3> <h2>[url='HonorExchange.php'] <font color = blue>Exchange Your awards here![/url] </h3> <table width='90%' class='table' cellspacing='2'><th>Level Awards</th><th>Crime Awards</th><th>Money Awards</th> <tr> <td>[url='h2.php?action=level5']Level 5 Honor Award[/url]</td> <td>[url='h2.php?action=c500']500 crimes completed[/url]</td> <td>[url='h2.php?action=1mill']1 million cash[/url]</td></tr> <tr> <td>[url='h2.php?action=level10']Level 10 Honor Award[/url]</td> <td>[url='h2.php?action=c1000']1000 crimes completed[/url]</td> <td>[url='h2.php?action=5mill']5 million cash[/url]</td></tr> <tr> <td>[url='h2.php?action=level15']Level 15 Honor Award[/url]</td> <td>[url='h2.php?action=c1500']1500 crimes completed[/url]</td> <td>[url='h2.php?action=10mill']10 million cash[/url]</td></tr> <tr> <td>[url='h2.php?action=level20']Level 20 Honor Award[/url]</td> <td>[url='h2.php?action=c2000']2000 crimes completed[/url]</td> <td>[url='h2.php?action=20mill']20 million cash[/url]</td></tr> <tr> <td>[url='h2.php?action=level25']Level 25 Honor Award[/url]</td> <td>[url='h2.php?action=c2500']2500 crimes completed[/url]</td> <td>[url='h2.php?action=50mill']50 million cash[/url]</td> <tr> <td>[url='h2.php?action=level30']Level 30 Honor Award[/url]</td> <td>[url='h2.php?action=c5000']5000 crimes completed[/url]</td> <td>[url='h2.php?action=100mill']100 million cash[/url]</td></tr> <th>Gang Awards</th><th>Donator Awards</th><th>Crystal Awards</th> <tr> <td>[url='h2.php?action=g100']100 Days in Gang[/url]</td> <td>[url='h2.php?action=d150']150 Donator Days[/url]</td> <td>[url='h2.php?action=cr2000']2000 Crystals[/url]</td></tr> <tr> <td>[url='h2.php?action=g200']200 Days in Gang[/url]</td> <td>[url='h2.php?action=d200']200 Donator Days[/url]</td> <td>[url='h2.php?action=cr5000']5000 Crystals[/url]</td></tr> <tr> <td>[url='h2.php?action=g300']300 Days in Gang[/url]</td> <td>[url='h2.php?action=d300']300 Donator Days[/url]</td> <td>[url='h2.php?action=cr10000']10000 Crystals[/url]</td></tr> <tr> <td>[url='h2.php?action=g400']400 Days in Gang[/url]</td> <td>[url='h2.php?action=d400']400 Donator Days[/url]</td> <td>[url='h2.php?action=cr20000']20000 Crystals[/url]</td></tr> <tr> <td>[url='h2.php?action=g500']500 Days in Gang[/url]</td> <td>[url='h2.php?action=d500']500 Donator Days[/url]</td> <td>[url='h2.php?action=cr50000']50000 Crystals[/url]</td></tr> </table>"; } if($_GET['action']=='level5') { if ($ir['level'] <5) { echo "You need to be level 5 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level5'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award one time! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level5')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations or reaching level 5. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='level10') { if ($ir['level'] <10) { echo "You need to be level 10 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level10'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award one time! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level10')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations or reaching level 10. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='level15'){ if ($ir['level'] <15) { echo "You need to be level 15 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level15'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level15')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations or reaching level 15. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='level20'){ if ($ir['level'] <20) { echo "You need to be level 20 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level20'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level20')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations or reaching level 20. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='level25'){ if ($ir['level'] <25) { echo "You need to be level 25 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level25'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level25')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations or reaching level 25. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='level30'){ if ($ir['level'] <30) { echo "You need to be level 30 to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='level30'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'level30')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on reaching level 30. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c500'){ if ($ir['crimesdone'] <500) { echo "You need to have done 500 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes500'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes500')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 500 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c1000'){ if ($ir['crimesdone'] <1000) { echo "You need to have done 1000 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes1000'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes1000')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 1000 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c1500'){ if ($ir['crimesdone'] <1500) { echo "You need to have done 1500 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); } $gh=mysql_query("SELECT * FROM honorawards WHERE userid=$userid AND list='crimes1500'",$c); if(mysql_num_rows($gh)) { print "You have already recieved that award you can only recieve each award once! "; print "[url='h2.php']Back to Honor Awards[/url] "; $h->endpage(); } else { mysql_query("INSERT INTO honorawards values ($userid,'crimes1500')",$c); mysql_query("UPDATE users SET honor=honor+1 WHERE userid=$userid",$c); print "Congratulations on completing 1500 crimes. You have been credited with one honor award."; print "[url='h2.php']Back to Honor Awards[/url] "; } } if($_GET['action']=='c2000'){ if ($ir['crimesdone'] <2000) { echo "You need to have done 2000 crimes to access here..."; echo " [url='h2.php']Go Back to Honor Awards[/url] "; $h->endpage(); }
  19. Re: [mccode V2] Very simple travel time mod. See thats my problem, like I have stated in a previous topic can't remember which one lol, I am just a beginner so I may not be doing things the most efficient way. I do know that yes you can have dedicated times but I'm not sure the query you would need to select the locations, I would say something like fetch array or something along those lines. and then it would be like if ($_GET['to'] ==1) { $rantime= the amount of time you want ; } etc, etc. But that could end up being alot of if's. So I do know there is a more efficient way to do it but I am not sure on how that part works. Believe me if I knew I would atleast try it, I just haven't gotten that far yet. I do know that if I am gonna be a good efficient respected game owner in the community then I atleast need to know programming in php some what thats why I am throwing little things out here in hopes that I can improve my skills with some constructive critisim. lol also josh-j-c I am not for certain on what exactly to do if you have different modes of travel in the game, but if I do find something out that works then I will for sure let you know. And thanks again for the comments or critisim.
  20. Re: Weird Problem actually I didn't take anything out lol. I just changed something. Trust me I have used 3 column templates many times I prefer them over two column and in every page you have to make sure that you have </table> to end that table if not it will place your 3rd column into the table as well. You had the </table> in there it was just in the wrong place. you had it as   print "<tr> <td>{$r['userid']}</td> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] $d</td> <td>[url='mailbox.php?action=compose&ID={$r[']Mail[/url]</td> <td>[url='sendcash.php?ID={$r[']Send Cash[/url]</td> <td>[url='friendslist.php?action=remove&f={$r[']Remove[/url]</td> <td>{$r['fl_COMMENT']}</td> <td>[url='friendslist.php?action=ccomment&f={$r[']Change[/url]</td> <td>$on</td></tr></table>"; } $h->endpage(); exit; }   notice in the code above that the </table> is before the } well in order for it to display correctly then it needed to be after the { like this   print "<tr> <td>{$r['userid']}</td> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] $d</td> <td>[url='mailbox.php?action=compose&ID={$r[']Mail[/url]</td> <td>[url='sendcash.php?ID={$r[']Send Cash[/url]</td> <td>[url='friendslist.php?action=remove&f={$r[']Remove[/url]</td> <td>{$r['fl_COMMENT']}</td> <td>[url='friendslist.php?action=ccomment&f={$r[']Change[/url]</td> <td>$on</td></tr>"; } print"</table>": $h->endpage(); exit; }   the other way would have worked correctly had there been anyone on the friends list but after the first person on the friends list the rest of them wouldn't have been included in the table. See what I am getting at. The way I have it it will include everyone inside that table then once its done with all of that it will end the table properly.
  21. Re: Weird Problem   <?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['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($ir['donatordays'] == 0) { die("This feature is for donators only."); } print " <h3>Friends List</h3>"; switch($_GET['action']) { case "add": add_friend(); break; case "remove": remove_friend(); break; case "ccomment": change_comment(); break; default: friends_list(); break; } function friends_list() { global $ir,$c,$userid,$h; print " [url='friendslist.php?action=add']> Add a Friend[/url] These are the people on your friends list."; $q_y=mysql_query("SELECT * FROM friendslist WHERE fl_ADDED=$userid",$c); print mysql_num_rows($q_y)." people have added you to their list. Most liked: ["; $q2r=mysql_query("SELECT u.username,count( * ) as cnt,fl.fl_ADDED FROM friendslist fl LEFT JOIN users u on fl.fl_ADDED=u.userid GROUP BY fl.fl_ADDED ORDER BY cnt DESC LIMIT 5",$c) or die(mysql_error()); $r=0; while($r2r=mysql_fetch_array($q2r)) { $r++; if($r > 1) { print " | "; } print "[url='viewuser.php?u={$r2r[']{$r2r['username']}[/url]"; } print "] <table width=90%><tr style='background:gray'> <th>ID</th> <th>Name</th> <th>Mail</th> <th>Send Cash</th> <th>Remove</th> <th>Comment</th> <th>Change Comment</th> <th>Online?</th></tr>"; $q=mysql_query("SELECT fl.*,u.* FROM friendslist fl LEFT JOIN users u ON fl.fl_ADDED=u.userid WHERE fl.fl_ADDER=$userid ORDER BY u.username ASC",$c); while($r=mysql_fetch_array($q)) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } $d=""; if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; } if(!$r['fl_COMMENT']) { $r['fl_COMMENT']="N/A"; } print "<tr> <td>{$r['userid']}</td> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] $d</td> <td>[url='mailbox.php?action=compose&ID={$r[']Mail[/url]</td> <td>[url='sendcash.php?ID={$r[']Send Cash[/url]</td> <td>[url='friendslist.php?action=remove&f={$r[']Remove[/url]</td> <td>{$r['fl_COMMENT']}</td> <td>[url='friendslist.php?action=ccomment&f={$r[']Change[/url]</td> <td>$on</td></tr>"; } print"</table>"; $h->endpage(); exit; } function add_friend() { global $ir,$c,$userid,$h; $_POST['ID'] = abs((int) $_POST['ID']); $_POST['comment']=str_replace(array("<",">","\n"),array("<",">"," "), $_POST['comment']); if($_POST['ID']) { $qc=mysql_query("SELECT * FROM friendslist WHERE fl_ADDER=$userid AND fl_ADDED={$_POST['ID']}",$c); $q=mysql_query("SELECT * FROM users WHERE userid={$_POST['ID']}",$c); if(mysql_num_rows($qc)) { print "You cannot add the same person twice."; $h->endpage(); exit; } if($userid==$_POST['ID']) { print "You cannot be so lonely that you have to try and add yourself."; $h->endpage(); exit; } if(mysql_num_rows($q)==0) { print "Oh no, you're trying to add a ghost."; $h->endpage(); exit; } mysql_query("INSERT INTO friendslist VALUES('', $userid, {$_POST['ID']}, '{$_POST['comment']}')",$c) or die(mysql_error()); $r=mysql_fetch_array($q); print "{$r['username']} was added to your friends list. [url='friendslist.php']> Back[/url]"; } else { print "Adding a friend!<form action='friendslist.php?action=add' method='post'> Friend's ID: <input type='text' name='ID' value='{$_GET['ID']}' /> Comment (optional): <textarea name='comment' rows='7' cols='40'></textarea> <input type='submit' value='Add Friend' /></form>"; } $h->endpage(); exit; } function remove_friend() { global $ir,$c,$userid,$h; mysql_query("DELETE FROM friendslist WHERE fl_ID={$_GET['f']} AND fl_ADDER=$userid",$c); print "Friends list entry removed! [url='friendslist.php']> Back[/url]"; $h->endpage(); exit; } function change_comment() { global $ir,$c,$userid,$h; $_POST['f'] = abs((int) $_POST['f']); $_POST['comment']=str_replace(array("<",">","\n"),array("<",">"," "), $_POST['comment']); if($_POST['comment']) { mysql_query("UPDATE friendslist SET fl_COMMENT='{$_POST['comment']}' WHERE fl_ID={$_POST['f']} AND fl_ADDER=$userid",$c); print "Comment for friend changed! [url='friendslist.php']> Back[/url]"; } else { $_GET['f'] = abs((int) $_GET['f']); $q=mysql_query("SELECT * FROM friendslist WHERE fl_ID={$_GET['f']} AND fl_ADDER=$userid",$c); if(mysql_num_rows($q)) { $r=mysql_fetch_array($q); $comment=str_replace(array("<",">"," "), array("<",">","\n"), $r['fl_COMMENT']); print "Changing a comment.<form action='friendslist.php?action=ccomment' method='post'> <input type='hidden' name='f' value='{$_GET['f']}' /> Comment: <textarea rows='7' cols='40' name='comment'>$comment</textarea> <input type='submit' value='Change Comment' /></form>"; } else { print "Stop trying to edit comments that aren't yours."; } } $h->endpage(); } ?>   try that
  22. Re: [mccode V2] Very simple travel time mod.   Huh??
  23. This is a very simple and easy to make mod and I'm sure there is something that is not secure about it so if there is something wrong with it and you can fix it then please do so. I would like to thank War_Hero for the idea of using travellingglobals.php with his club mod. Hope ya don't mind me using that little bit in this. Anyway on to the mod. I use the travellingglobals.php for my jail, hospital, searchtime, as well as traveltime. It saves down on alot of if ($ir['blah'] so I will just post the whole thing. the SQL ( if you are already using War_Hero's club mod then you already have this in your DB and don't need to run it. )   ALTER TABLE `users` ADD `traveltime` INT(11) NOT NULL DEFAULT '0';   save this as travellingglobals.php ( if you already have War_Hero's club mod you have this file already )   <?php if($ir['traveltime'] > 0) { print"<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>"; $h->endpage(); exit; } ?>   I have to use the print " ": $h->endpage(); exit; for it to make everything look correctly on my game if someone else knows of a way to make it work better and still include the endpage as I have to have it due to my 3 column template I am working on them please let me know. replace your monorail.php with this one.   <?php include "globals.php"; include "travellingglobals.php"; $rantime = rand(2,7); $cost=1000; $_GET['to'] = abs((int) $_GET['to']); if(!$_GET['to']) { print "Welcome to the {$set['game_name']} Station. It costs \$$cost for a ticket. Where would you like to travel today? "; $q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}"); print "<table width=75% cellspacing=1 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)) { print "<tr><td>{$r['cityname']}</td><td>{$r['citydesc']}</td><td>{$r['cityminlevel']}</td><td>[url='monorail.php?to={$r[']Go[/url]</td></tr>"; } print "</table>"; } else { if($ir['money'] < $cost) { print "You don't have enough money."; } else if( ((int) $_GET['to']) != $_GET['to']) { print "Invalid city ID"; } else { $q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}"); if(!$db->num_rows($q)) { print "Error, this city either does not exist or you cannot go there."; } else { $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(); ?>   Now to make it where you can't do anything while you are travelling then you need to place   include "travellingglobals.php";   at the top of which ever page/s you don't want them to access while they are travelling. And if you want it to display how much time they have left while they are travelling then open header.php find this   if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; }   and put this either above or below it doesn't matter   if($ir['traveltime'] > 0) { print "<font color = 'red' />[b]Travelling for [b]{$ir['traveltime']} minutes[/b].</font> "; }   Also add this into your cron_minute.php   $db->query("UPDATE users SET traveltime = traveltime - 1 WHERE traveltime > 0");
  24. Re: [mccode v2] Lucky Bags works great War_Hero. Thanks Another thing I saw is someone wanted it to " quantify " in their inventory, thats easy. replace this   $db->query("INSERT INTO inventory VALUES('',$item,$userid,1)",$c);   with this   item_add($userid, $item, 1); $i=($db->insert_id()) ? $db->insert_id() : 99999;   thats what I use when anyone receives an item in my game and works great, its just standard in V2.
  25. I am working on a mod that I got off of here quite a while back I believe it was killahs password protect without sql mod. Anyway I have made it where each user can have their own password for which ever page I place it on, right now its for my staff panel. Anyway, once I promote the user to staff they receive their temporary password that will allow them to login but that password expires after 24 hours. So once they login they have to change their password. Well the problem I am having is it won't update the said column in the database. here is the bit of code which I have taken from preferences and change it around some to work with this.   function pass_change() { global $ir,$c,$userid,$h; print "<h3>Staff Panel Password Change</h3><form action='staff.php?action=passchange2' method='post'> Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $db,$ir,$c,$userid,$h; if($_POST['oldpw'] != $ir['staffpass']) { print "The current password you entered was wrong. [url='staff.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='staff.php?action=passchange']> Back[/url]"; } else { $string = $_POST['newpw']; $salt = 's+(_a*'; $hash = md5($string.$salt); $db->query("UPDATE users SET staffpass= $hash WHERE userid=$userid"); print "Password changed!"; } }   That is what I am using in hopes that I can get it to work. If I am doing something wrong then please let me know what it is so I can fix it. I have been working on this for about 3 hours now with no luck so I thought I would turn to the good members of CE for help. Oh and this is the error I am getting when I try to use that.   QUERY ERROR: Unknown column '------------------------------------------------' in 'field list' Query was UPDATE users SET staffpass= ------------------------------------------------- WHERE userid=1   and yes I left out the result of the md5($string.$salt); lol don't know if it matters or not but hey better to be safe than sorry. I am new to all of this still yet but I am trying to learn things on my own and what better way to learn than do it.
×
×
  • Create New...