Jump to content
MakeWebGames

Will

Members
  • Posts

    215
  • Joined

  • Last visited

    Never

Everything posted by Will

  1. Re: Counting (nr game) 1763
  2. Will

    WWI

    Re: WWI Germany-11 Great Britan-89
  3. Re: Guess the next poster No! Younggold next
  4. Re: Counting (nr game) 1761
  5. Will

    WWI

    Re: WWI Germany-14 Great Britan-86 Common Great Britian!
  6. Will

    WWI

    Re: WWI Germany-18 Great Britan-82
  7. Re: Counting (nr game) 1758
  8. Will

    Optimize generation

    Re: Optimize generation Ok I have re-thought my database and now have 65536 tables for the first four letters. For this I have to make some new code but it runs really slow..... Can anyone please optimize this: <?php //how many to do $rf=500; //Start and end values $s=$t; $e=$s+$rf; echo " Start: $start "; for ($y=$s; $y<$e; $y++) { $mds = base_convert($y, 10, 36); echo 'Number = '.$y.' - String = '.$mds . ' '; //work out vlaues $v=md5($mds); $tb=substr($v,0,4); $in=substr($v,4,29); //add to DB mysql_query("INSERT INTO `m".$tb."` VALUES('".$mds."', '".$in."' )") or die('INSERT ERROR'.mysql_error()); } //done echo "End {$e}<hr />"; ?>   Thanks
  9. Will

    Optimize generation

    Re: Optimize generation The password decrypting isn't it's main purpose. I'm just trying to make a large database with all the values in. I've got a faily fast server running Windows Server 2003 with SQL server which I plan to use just for this. I just have to learn a whole new programming language now (ASP)...
  10. Will

    Optimize generation

    Re: Optimize generation In what way...
  11. Re: How do i make myself staff? Does it really matter :? :? :? :?
  12. Re: [mccode][v1]+[v2]Automatic total cost calculation in shop buy. That looks right.
  13. Re: How do i make myself staff? Assistant is '4'
  14. Re: Better than Quantifying Oh, forgot to say. The insert and search queries are different than normal because I've changed the system slightly on my game. You'll have to change it.
  15. Re: Better than Quantifying That looks like all of them. If you have some kind of gang armoury It might need to be added to that; on mine I put the gang lent items separately though. Here's my section of the code for each one: Item send $rfr=mysql_query("SELECT inv_id,inv_itemid FROM inventory WHERE inv_itemid='{$r['inv_itemid']}' AND inv_userid='{$_GET['user']}' AND inv_lent=0",$c) or die(mysql_error()); $y=mysql_fetch_array($rfr); { if(mysql_num_rows($rfr) == 0) { //create seperate $qut=$_GET['qty']; mysql_query("INSERT INTO inventory VALUES ('','{$r['inv_itemid']}',{$_GET['user']},{$_GET['qty']},0,0,0);",$c); mysql_query("UPDATE inventory SET inv_qty=inv_qty-$qut WHERE inv_id={$_GET['ID']} LIMIT 1;",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0", $c); } if(mysql_num_rows($rfr) >=1) { $qut=$_GET['qty']; $itemid=$y['inv_id']; mysql_query("UPDATE inventory SET inv_qty=inv_qty+$qut WHERE inv_id=$itemid",$c) or die(mysql_error()); mysql_query("UPDATE inventory SET inv_qty=inv_qty-$qut WHERE inv_id={$_GET['ID']} LIMIT 1;",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0", $c); } print "You sent {$_GET['qty']} {$r['itmname']}(s) to {$rm['username']}"; event_add($_GET['user'],"You received {$_GET['qty']} {$r['itmname']}(s) from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c); mysql_query("INSERT INTO itemxferlogs VALUES('',$userid,{$_GET['user']},{$r['itmid']},{$_GET['qty']},unix_timestamp())",$c); $h->endpage();   Item Buy   $price=($itemd['itmbuyprice']*$_POST['qty']); $rfr=mysql_query("SELECT inv_id FROM inventory WHERE inv_itemid={$itemd['itmid']} AND inv_userid=$userid AND inv_lent=0",$c) or die(mysql_error()); $r=mysql_fetch_array($rfr); { if(mysql_num_rows($rfr) == 0) { mysql_query("INSERT INTO inventory VALUES('', {$itemd['itmid']}, $userid, {$_POST['qty']},0,0,0);",$c) or die(mysql_error()); mysql_query("UPDATE users SET money=money-$price WHERE userid=$userid",$c) or die(mysql_error()); mysql_query("INSERT INTO itembuylogs VALUES ('', $userid, {$_GET['ID']}, $price, {$_POST['qty']}, unix_timestamp(), '{$ir['username']} bought {$_POST['qty']} {$itemd['itmname']}(s) for {$price}')", $c); print "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price"; } if(mysql_num_rows($rfr) >=1) { $qut=$_POST['qty']; $itemid=$r['inv_id']; mysql_query("UPDATE inventory SET inv_qty=inv_qty+$qut WHERE inv_id=$itemid",$c) or die(mysql_error()); mysql_query("UPDATE users SET money=money-$price WHERE userid=$userid",$c); mysql_query("INSERT INTO itembuylogs VALUES ('', $userid, {$_GET['ID']}, $price, {$_POST['qty']}, unix_timestamp(), '{$ir['username']} bought {$_POST['qty']} {$itemd['itmname']}(s) for {$price}')", $c); print "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price"; } }   You get the gist by now :lol:
  16. The quantifying mod is pointless. All you have to do which will save resources. Basically every time an item is given to someone it checks to see if the item is already there and just adds more:   $rfr=mysql_query("SELECT inv_id,inv_itemid FROM inventory WHERE inv_itemid='{$r['inv_itemid']}' AND inv_userid='{$_GET['user']}' AND inv_lent=0",$c) or die(mysql_error()); $y=mysql_fetch_array($rfr); { if(mysql_num_rows($rfr) == 0) { //create seperate $qut=$_GET['qty']; mysql_query("INSERT INTO inventory VALUES ('','{$r['inv_itemid']}',{$_GET['user']},{$_GET['qty']},0,0,0);",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0", $c); } if(mysql_num_rows($rfr) >=1) { $qut=$_GET['qty']; $itemid=$y['inv_id']; mysql_query("UPDATE inventory SET inv_qty=inv_qty+$qut WHERE inv_id=$itemid",$c) or die(mysql_error()); mysql_query("DELETE FROM inventory WHERE inv_qty=0", $c); }   This can be modded for anything from the shops to the item send page.
  17. Re: Money,crystals cap I was talking about the userstats they use decimal places. This particularly affects new users where they are earning less than 1 a train.
  18. Re: Money,crystals cap :x What did I say about the userstats; it is a DECIMAL!!!! they can be made bigger than an INT by changing the first value. Changing them to anything other than a decimal will mess up the stats.
  19. Re: Money,crystals cap And DO NOT Change the users stats to INT. They are currently Decimals as your stats have decimals. Running these queries will mess up your game.
  20. Re: Money,crystals cap That won't work, an INT value is still limited to 2147483647
  21. Re: Slower Crons   Then 15 seconds later plays Death Metal XD.   <?php echo "hi"; sleep(15); echo "<embed src=music/ARTISTNAME/SONGNAME.MUSICEXT />"; ?>   You should run the php script then use some javascript to start the music. You shouldn't let a script run for longer than needs be.
  22. Re: V2 a custom gym problem To fix just put the sum outside the query.   $db->query("UPDATE `users` SET `exp` = (`exp`+$gain/40) WHERE `userid` = $userid"); to $insert=$gain/40; $db->query("UPDATE `users` SET `exp` +={$insert} WHERE `userid` = {$userid}");   I think that would fix it, how about printing the $gain first to check it's a value.
  23. Re: Slower Crons Technically it would take longer to run and could hit the 30 second limit unless you change the time limit. No point It wouldn't make and difference. If you are worried about too much load at once have parts running at different times.
  24. Re: XHTML Valid Game? Takes longer because you have to copy and paste the HTML every time.
  25. Re: heredoc, heredoc what? Yeah, that works.
×
×
  • Create New...