Jump to content
MakeWebGames

Ragnar

Members
  • Posts

    150
  • Joined

  • Last visited

    Never

Everything posted by Ragnar

  1. Re: exp bar goes over 100%? What causes the bar to get huge, is geting 'too much' experience for the level the player is at. All the player has to do is reload the page. Each time he'll gain a level until it's back to normal. er, why would some one complain about it being so easy to level up!!! Make the property give out less will for the players to get less experience.
  2. Re: [Guide]MC Economy The guide doesn't even cover the mother of all inflation generators, the biggest thing that effects the economy...bank interest!!!! One game I play was reset about four months ago. I started playing it 85 days ago. Siting in my bank is $78,632,145,127,625,711. Oh, the bank interest is set at 15% for us supporters, so I'll make about 10 quad tonight!!!!!! Then in a few other games, I'm siting on the max... $9,223,372,036,854,775,807!!!!! Keeping the game interesting can be a challenge when you got very little cash coming in the game.
  3. Re: [v2] Cannot be attacked for 2 days Another version.... If($ir['level']>5 && $odata['level'] < 5 && $odata['daysold'] < 10 && $odata['fedjail'] < 1) { print "I'm sorry, but at your level, you cannot attack players under level 5 that joined less than 10 days ago, unless they are banned.   > Back"; $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }
  4. Re: Ajax chat for V2   also for :'( it does this basically anything with a ' in it adds a \ before it. Anyway to fix that? (V1 version) It's extremely easy to fix that. Just censor it!! $message = str_replace("\'","'",$message); \' now shows up as ' with out the \.
  5. Re: Crons stoped working. Two words: unix timestamp. Contact MCcodes. They can do that....for a price, depending on how much you want changed, just minute and five minute crons, or every thing.   BTW, the original cause of the crons not working had nothing to do with the server. Some one was doing mySQL injections on them. Changing the file permissions and URL of the cron files fixed it. (For example cron_fivemins666911133790210666.php) I changed them to Chmod 744, except the day cron. Even if you load the script from the browser, with the required code in the URL, the script doesn't run. Only the server can run the file. (If you do this with the day cron file, you don't get the daily job pay/stats.)
  6. Re: Fix to a forum bug: Apostrophe in thread title. Send that link to MCcodes who made the crummy code in the first place!! Every one who bought the script has that code. All I did was get rid of the annoying error, so it's no less secure than it already was. And buy the v2 of the script, fix every secure bug, and post a paid mod with all the search and replace codes to fix them! :-D Sell for $50 and after six sales and you'll start racking in the cash, and we'll all have a much more secure game!! :-D
  7. If you get.... 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 're not training when...' WHERE ff_id=4' at line 1 Query was UPDATE forum_forums SET ff_lp_time=unix_timestamp(), ff_posts=ff_posts+1, ff_lp_poster_id=302, ff_lp_poster_name='nesqueen', ff_lp_t_id=210, ff_lp_t_name='You know you're not training when...' WHERE ff_id=4 when you reply to a thread, and it's still added, it get's generated when you reply to the thread that has a Apostrophe (') in the title. Replace $db->query("UPDATE forum_forums SET ff_lp_time=unix_timestamp(), ff_posts=ff_posts+1, ff_lp_poster_id=$userid, ff_lp_poster_name='$u', ff_lp_t_id={$_GET['reply']}, ff_lp_t_name='{$topic['ft_name']}' WHERE ff_id={$forum['ff_id']}"); with $db->query("UPDATE forum_forums SET ff_lp_time=unix_timestamp(), ff_posts=ff_posts+1, ff_lp_poster_id=$userid, ff_lp_poster_name='$u', ff_lp_t_id={$_GET['reply']}, ff_lp_t_name='{$_POST['ft_name']}' WHERE ff_id={$forum['ff_id']}"); to fix it.
  8. Re: Gym error: Fatal error: Maximum execution time of 60 seconds exceeded Thanks a lot! for($i=0; $i<$_POST['amnt']; $i++) was doing it. If I get rid of that code, it's as if I got one energy (No loop.)! If I change it to for($i=0; $i<$ir['energy']; $i++) you gain about the same amount of stats for the same price, and it's MUCH faster, only looping your energy and not cash!!! Hundreds of loops is much better than millions!!
  9. Re: Gym error: Fatal error: Maximum execution time of 60 seconds exceeded I can't find any hint of a loop. Here's the code. The crazy thing is, this only happens to one player. I've seen money gyms in other games where you pay way more than 15 million each time that don't spit out the error. (Think costing billions and trillions at 2452 games.)   <?php $macropage="gym.php"; include "globals.php"; if($ir['hospital']) { die("This page cannot be accessed while in hospital."); } if($ir['location'] == 1) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 2) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 3) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 4) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 5) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 7) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 8) { die("You can only train here when you are in Viridian."); } if($ir['location'] == 10) { die("You can only train here when you are in Viridian."); } $statnames=array( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'IQ' => 'IQ', 'Labour' => 'labour'); $_POST['amnt']=($ir['will']*5*$ir['energy']); if(!$ir['jail']) { print "<h3>Viridian Gym</h3><hr />"; } else { print "<h3>Viridian Jail Gym</h3><hr />"; } if($_POST['stat'] && $_POST['amnt']) { $stat=$statnames[$_POST['stat']]; if(!$stat) { die("This stat cannot be trained."); } if($_POST['amnt'] > $ir['money']) { print("You do not have enough money to train that much.<hr />"); } else { $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { $gain+=round(rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150)); $ir['will']-=rand(1,3); if($ir['will'] < 0) { $ir['will']=0; } } if($ir['jail']) { $gain/=2; } $db->query("INSERT INTO trainlogs VALUES('',$userid,'$stat',$gain,unix_timestamp());",$c); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `will` = will - (({$ir['maxwill']})/100), money = money - {$_POST['amnt']} WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `exp` = exp + {$ir['exp_needed']} / 100 WHERE `userid` = $userid AND `maxenergy` = {$_POST['amnt']}"); $inc=$ir[$stat]+$gain; $inc2=$ir['money']-$_POST['amnt']; if($stat=="strength") { print "You begin lifting some weights. You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights. You now have {$inc} strength and {$inc2} money left."; } elseif($stat=="agility") { print "You begin running on a treadmill. You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running. You now have {$inc} agility and {$inc2} money left."; } elseif($stat=="guard") { print "You jump into the pool and begin swimming. You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming. You now have {$inc} guard and {$inc2} money left."; } elseif($stat=="IQ") { print "You spend time at Mario University. You have gained {$gain} IQ by spending {$_POST['amnt']} minutes there. You now have {$inc} IQ and {$inc2} money left."; } elseif($stat=="labour") { print "You walk over to some boxes filled with gym equipment and start moving them. You have gained {$gain} labour by moving {$_POST['amnt']} boxes. You now have {$inc} labour and {$inc2} money left."; } print "<hr />"; $ir[$stat]+=$gain; } } $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); print "Choose the stat you want to train and the times you want to train it. You can train up to {$ir['energy']} times costing $ {$_POST['amnt']}.<hr /> <form action='viridiangym.php' method='post'> Stat: <select type='dropdown' name='stat'> <option value='Strength'>Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) <option value='Agility'>Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) <option value='Guard'>Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) <option value='Labour'>Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) <option value='IQ'>IQ (Have {$ir['IQ']}, Ranked {$ir['IQrank']}) </select> Times to train: <input type='text' name='amnt' value='{$ir['energy']}' /> <input type='submit' value='Train' /></form>"; $h->endpage(); ?>
  10. Re: Gym error: Fatal error: Maximum execution time of 60 seconds exceeded This gym uses cash, and he's paying 15 million bucks per train. Even if it was crystals, it would only be eight crystals. And it doesn't take 30 seconds to pay out, otherwise the markets and stores would always be generating that error. Based on your thery, every single $10,000 or above transaction would cause the error, since money and crystals are the exact same thing, just used for different stuff. $_POST['amnt']=($ir['will']*5*$ir['energy']); $db->query("UPDATE `users` SET money = money - {$_POST['amnt']} WHERE `userid` = $userid"); It doesn't take much at all for the script to figure out the cost and make payment. You can do transactions in the quintillions and that wouldn't generate the error. (Luckly the game hasn't got even close to quads yet!!) :-D
  11. This error only shows up for ONE player.... Fatal error: Maximum execution time of 60 seconds exceeded in /public_html/viridiangym.php on line 49 The code of that line is.... $gain+=round(rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150)); where it decides how much stats you gain. Is there anything there that can be changed to stop the error, or could it be his stats... INSERT INTO `userstats` VALUES (264, 14242950, 11653749, 10626609, 12381860, 12908602, 'yes'); It works fine for me and all other players that have used this gym. My stats... INSERT INTO `userstats` VALUES (1, 60627, 19960, 19352, 260384, 243616, 'yes');
  12. Re: Merge Item's [V2]   You should really think about buying the script some time. By default, when a player gets an item you already have, the dumb script doesn't merge them, but shows them twice on the item page, the new items and the ones you already had.
  13. Re: Hi I Got An Error If you get that error on the Mail Compose Message page, when you use the 'Compose Message' link, replace { $user=$db->fetch_single($db->query("SELECT username FROM users WHERE userid={$_GET['ID']}")); } with if($_GET['ID']) { $user=$db->fetch_single($db->query("SELECT username FROM users WHERE userid={$_GET['ID']}")); }
  14. Re: Own 50% of my game if you help with codeing and adding mods Two years!!!! :-o :-o :-o Study the code! I was a total php/mySQL n00bie when I bought the v2 script in February. Two and a half months later I had the game all made, had made a few of my own mods, and then released the game a month later, after playing the game myself to test out the economy!! Now it has addicted players playing the game like crazy!!
  15. Re: Giving Item To All Users [FREE] Is it possible to make it so only players that last loged on with in XXXX seconds get the item, using the unix timestamp? For example, for five days, having the current unix timestamp number be less than 432,000 above the number at 'laston' in the 'users' table.
  16. Re: Ignore User Mails [$10] Does this have it set so players can't put Staff Members on ignore?
  17. Re: Force a 'Topic Name' in forum thread? replacing function newtopic() { global $ir, $c, $userid, $h, $bbc, $db; $q=$db->query("SELECT * FROM forum_forums WHERE ff_id={$_GET['forum']}"); $r=$db->fetch_row($q); with function newtopic() { global $ir, $c, $userid, $h, $bbc, $db; $q=$db->query("SELECT * FROM forum_forums WHERE ff_id={$_GET['forum']}"); $r=$db->fetch_row($q); if(strlen($_POST['ft_name']) < 4) { die("Add a title."); } in forums.php did it.
  18. Is there any way to force a topic name for a forum thread? You can leave that blank and the thread get's created but...no title = no link to the thread. If not, is there a way to create a title by editing the original post? Giving it a 'Subject' doesn't edit the thread title.
  19. Re: strang ' marks appearing There's nothing wrong with your database. I had this same bug. In staff_crimes.php replace Initial Text: <textarea rows=4 cols=40 name='crimeITEXT' />{$itemi['crimeITEXT']}'</textarea>   with Initial Text: <textarea rows=4 cols=40 name='crimeITEXT' />{$itemi['crimeITEXT']}</textarea>   Notice the extra ' in the textarea. Much easior that 'spending several hours to fix this myself!!' :-o :-D   It's only a silly question to any one that's never had the problem. It makes perfect sense to any one that's had the problem, which is every one that uses version 2 and has tried editing a crime.
  20. Re: Call to a member function query() on a non-object - Error in my forum Thanks. For me, adding $db fixed the deleting posts error. When trying to delete the thread, I get Fatal error: Call to a member function on a non-object in /home/virtual/site7/fst/var/www/html/forums.php on line 707 $r=$db->fetch_row($q); which is at $db->query("UPDATE forum_topics SET ft_locked=-ft_locked+1 WHERE ft_id={$_GET['topic']}"); $q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}"); $r=$db->fetch_row($q); print "{$r['ft_name']}'s lock status changed, if it was unlocked, it will now be locked, otherwise, it will be unlocked."; if($r['ft_locked']==0) { stafflog_add("Unlocked Topic {$r['ft_name']}"); Even though locking works just fine!
  21. Re: Crons stoped working.   Read da thread before posting!!! (For da lazy ones...I'm on my own dedicated server.) It's been two days since they didn't work. I changed the file names of the game crons and permission setting of the files. er, so much for the long code in the URL providing protection! :roll: As back-up, if they find the new URLs and can do the sql injections with the new permission settings, I set the crons up on a domain that only I use, and will delete the ones on the game domain. (Before you could run the crons from the browser. Now only the server can run them.) Some one once said MCcodes security really sucks. And they were right!! Now, if only people knew how to fix the security cracks! Obviously the tiny market/forum codes don't cover it!
  22. Re: Crons stoped working. er...they work, then stop working, then work... June 3: Stopped at about 8:30 PM. June 4: Noon PST they started working, then not very long after that, stopped. June 4: 4:34:00 pm PST, started up again. June 5, 3:35:00 pm Stoped, then at 4:15:01 PM started up again. From another forum...   Ummm!!!
  23. Re: [V1 and V2] Optimize Tables once an hour. You can easily put it in the day cron. I decided to put it in the crons cause after just a week of releasing the game, I started geting some weird errors....then finally got something like Can't open file: 'users.MYD'. (errno: 145 which could only be fixed by repairing it. If it's optimized every hour, odds are, it'll never get to where tables have to be repaired. Just 30 minutes after the cron did it, I did it in phpMyAdmin, and nine tables spit out 'OK' instead of 'Table is already up to date.'
  24. Just adding one line can do this! Get a list of all your tables. Then in cron_hour.php replace   $set[$r['conf_name']]=$r['conf_value']; }   with   $set[$r['conf_name']]=$r['conf_value']; } $db->query("OPTIMIZE TABLE `announcements` , `applications` , `blacklist` , `challengebots` , `challengesbeaten` , `cities` , `clogs` , `contactlist` , `courses` , `coursesdone` , `crimegroups` , `crimes` , `cronlogs` , `crystalmarket` , `crystalxferlogs` , `dps_accepted` , `events` , `fedjail` , `forum_forums` , `forum_posts` , `forum_topics` , `friendslist` , `gangevents` , `gangforums_replies` , `gangforums_topics` , `gangs` , `gangwars` , `houses` , `hpmarket` , `imarketaddlogs` , `imbuylogs` , `imremovelogs` , `inventory` , `itembuylogs` , `itemmarket` , `items` , `itemselllogs` , `itemtypes` , `itemxferlogs` , `jaillogs` , `jobranks` , `jobs` , `logsdonation` , `mail` , `oclogs` , `orgcrimes` , `papercontent` , `polls` , `preports` , `referals` , `settings` , `shopitems` , `shops` , `stafflog` , `staffnotelogs` , `statsmarket` , `surrenders` , `unjaillogs` , `users` , `userstats` , `votes` , `willps_accepted`");   with the tables listed being all of the ones you got. (Don't copy this, or you'll probably get an error for unknown tables, and miss tables you got that arn't listed.) Change   $db->query   to   mysql_query   if you're using v1. Added code tags -- Tezza`
  25. Re: Crons stoped working. I'm on a dedicated server, not a shared hosting company!!
×
×
  • Create New...