Jump to content
MakeWebGames

[mccode] Credit Gym [v1]


Z?v??

Recommended Posts

This was very simple to make but someone might find this useful. I just edited the regular gym.php. This is called creditgym.php but if you want to change it to crystals or diamonds or whatever, just change all the instances of credits in the code.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

You need to go validate.Please Click Here To Validate");
}
$_GET['times']= abs((int) $_GET['times']);
if($ir['validated'] < 1)
{
die("
You need to go validate.

Link to comment
Share on other sites

Re: Credit Gym

You did not make it.

Its original mcc.

Yea just altered energy into credits but nothin gmore..

mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,credits=credits-1,exp=exp+$egain WHERE userid=$userid

".mysql_error());

Link to comment
Share on other sites

Re: Credit Gym

Holy shit, you have one query per train? And you wonder why you're all getting kicked off hosting for using up too much resources?

What if someone has like 100 energy, that'd make it 100 queries per train...yeeeeeeesh

Someone needs to teach optimization here

Link to comment
Share on other sites

Re: Credit Gym

It isn't just TC's way of doing it, it's anyone who's smart enough to figure out how to reduce sql server load and reduce queries, and stress on the sql server.

It's 1000x more efficient to construct a query in a loop, then once it's ended, run the query, instead of hundreds of smaller ones.

Just as an example,

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

is horrible compared to:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...