Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1

    Unhappy Gym train energy usage

    I was wondering if there would be a way for me to change the amount of energy used when training in the gym. It currently uses 1 energy but I would like to change it to 5. Would somebody be able to provide me with a guide on how to do this?

    Thanks in advance,
    Ashley Jackson

  2. #2
    In your gym.php look at all the UPDATE queries and see what $var it is, I can't remember which one, but in the query it should be like... energy=energy-$cost
    then look for that var $cost=.... and there you will find the calculations.

  3. #3
    I've looked through the code for about 20 minutes and It is confusing, it states that It uses 'amnt' but I can't find it where is creates the 'amnt'.

  4. #4
    If I remember correctly, the 'amnt' is set in a $_POST variable, thus meaning it comes from a previous page request. This is probably the form you have to fill in when training where it asks you how many trains you would like to do of what type of stat. Changing it to using 5 energy all the time, means you would need to change your script a little bit.

    MCC users start of with 12 energy and increases per 2 by each level they make, I believe.
    Web developer
    -----
    MakeWebGames Administrator Faq & Rules thread
    MCC Owners / Developers: please read MCC - MWG Relation

  5. #5
    1. Is there a way to remove that increase?
    2. I can't find the post variable, If I were to post the code would you be able to help?

  6. #6
    If you post it, yes we can help.

  7. #7
    If it is a stock v2 script in the global_func.php file there is a function called "check_level()" replace that with: (this will stop the increase in Energy for every Level gained.)



    *for some reason when displaying the code there is a space in the maxbrave; that shouldn't be there...

    As for the gym; post up the script and one of us will be able to help
    Last edited by Maniak; 01-21-2012 at 06:08 PM.

  8. #8
    Under...


    Add..

    $energy=($_POST['amnt']*5);

    Change this query..

    To...


    Then find...


    Replace with..


    Then find..

    Replace with...



    This was quick, but an example how to do it... As for the last part you may want to fix the print and make it all echo ' '; like i did here ...echo ' value="'.intval($ir['energy']).'" /><br />';
    I was just too lazy to go through it and change it all lol...

  9. #9
    If you do not want the 12 energy... and want 100 for none and 150 for donators... go into global_func.php erase the energy stuff in the function part Maniak posted, then open header.php and find...


    Above that, add:


    You will also need to change the INSERT query on the register page, and add 100 instead of 12

  10. #10
    Whoa, Thanks Guys. So much help here. I will try to add that and see what happens.

Page 1 of 2 12 LastLast

Similar Threads

  1. Resource usage - MCCodes bad?
    By Macintrash in forum General
    Replies: 4
    Last Post: 01-04-2011, 06:19 AM
  2. Travel Timer. Wait for the train. LITE V1 V2
    By Agon in forum Requests & In Production
    Replies: 9
    Last Post: 06-23-2010, 10:27 AM
  3. Energy not going up?
    By legrolls in forum General Discussion
    Replies: 9
    Last Post: 07-28-2009, 10:28 AM
  4. Energy bar
    By Pieces in forum Other Programming
    Replies: 7
    Last Post: 06-21-2009, 01:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •