[MOD] Bonus 1.8-1.9-2.0-2.1

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [MOD] Bonus 1.8-1.9-2.0-2.1

      Bonus 1.8-1.9-2.0-2.1

      New mod day bonus works on all 100% :thumbup:
      Files

      The post was edited 7 times, last by Coswars ().

    • Hallo liebe Gemeinde,

      ich bin ganz neu hier und hab mir 2Moons bzw. STEEMNOVA auf meinem Homeserver installiert.
      Es klappt soweit auch.

      Aber kann ich dort auch die Mods von hier verwenden?
      Und wenn ja, wie muss ich dabei vorgehen?

      Entschuldigt bitte meine Unwissenheit diesbezüglich!

      Zunächst hätte ich gerne diesen BONUS Mod und den Left-Navi Mod.

      Vielen lieben Dank schon mal für eure Hilfe!
    • Vertex wrote:

      Hallo liebe Gemeinde,

      ich bin ganz neu hier und hab mir 2Moons bzw. STEEMNOVA auf meinem Homeserver installiert.
      Es klappt soweit auch.

      Aber kann ich dort auch die Mods von hier verwenden?
      Und wenn ja, wie muss ich dabei vorgehen?

      Entschuldigt bitte meine Unwissenheit diesbezüglich!

      Zunächst hätte ich gerne diesen BONUS Mod und den Left-Navi Mod.

      Vielen lieben Dank schon mal für eure Hilfe!
      Советую почитать тебе это
    • Thank you very much!
      Now I know how to create a new side inside the game.

      But how can I use the BONUS Mod?

      That is not answered in the thread.

      Sorry, but my question was:

      How can I use this mod with steemnova?

      When I have to modify the whole mod it's not useful for me.
      Sorry.
    • Vertex wrote:

      Thank you very much!
      Now I know how to create a new side inside the game.

      But how can I use the BONUS Mod?

      That is not answered in the thread.

      Sorry, but my question was:

      How can I use this mod with steemnova?

      When I have to modify the whole mod it's not useful for me.
      Sorry.
      1. Сделать запрос к БД (Addon.sql) или просто залить этот файл к вашей базе данных.
      2. В main.navigation.tpl написать в меню <li><a href="game.php?page=bonus">bonus</a></li> (чтобы добавить ссылку на новый мод)
      3. В СВОЙ AbstractGame...php залить из AbstractGame...php (который лежит в моде) строчки 142-156
      4. Перенести ShowBonusPage.class к game файлам.

      И да руководствуйся ТУТОРИАЛОМ, который я тебе скинул.
    • OK. Thanks.
      But WHERE I have to upload AbstractGamePage.class.php and ShowBonusPage.class.php?


      Into the root of the game or can you tell me the right path?

      EDIT:
      I found it here:

      /includes/pages/game

      Is this correct?
      But here the AbstractGamePage.class.php already exists.

      And when I now click on BONUS in the navigation, I get this information:


      Your renewal time has not yet elapsed


      So where can I set the time?


      Thanks a lot for help!

      EDIT 2:
      After a test, the player has know over 3.000.000 metal, crystal and deuterium??????
      How can I change this back to normal without resetting the universe?

      The post was edited 2 times, last by Vertex ().

    • Really nobody else with the same problem?
      Now I have 2moons installed and the same problem wit this mod.

      After the first click on BONUS the player has more than 2.000.000.000 metal, crystal and deuteurium!

      Where is the error?
    • That should be in the ShowBonusPage.class.php

      You can edit how much resources will be given if your game has modifications then don't upload AbstractGamePage.class.php, just open it up and add the changes for this mod to yours
    • Thanks.
      I found case 1 till case 5.
      But I only need ONE case. After XX hours the player can receive XXXX DM, and/or metal, crsytal and deuterium.

      Can you explain how I can do this?

      I'm very sorry but I'm a absolutely noob in PHP ;)

      I think my problem is/was case 5.

      Source Code

      1. $time = TIMESTAMP + 24*60*60 ;
      2. $metal = mt_rand(200000000 , 400000000);
      3. $crystal = mt_rand(200000000 , 400000000);
      4. $deuterium = mt_rand(200000000 , 400000000);
      5. $darkmatter = mt_rand(3200000000 , 6400000000);
      And what exactly is TIMESTAMP + 24*60*60??

      Thanks a lot for help.
    • yup can edit the rss their and change the time stamp

      $time = TIMESTAMP + 24*60*60 ;
      // 24 hours; 60 mins; 60 secs

      change as needed to suit your game, just remember that it runs on utc time
    • OK. I've edited the timestamp.
      But when a user gets the bonus, on the next day no more login.
      Error on line 153 in AbstractGamePage.class.php.

      This is my line 153:

      Source Code

      1. $db->update("UPDATE %%USERS%% SET `bonus_attente_time` = ". $time .";");


      So I think I have to edit these lines too?


      Source Code

      1. if($USER['bonus_attente_time'] == 0){
      2. $BonusTemps = 0;
      3. $secsBonus = 0;
      4. }
      5. if($USER['bonus_attente_time'] < TIMESTAMP && $USER['bonus_attente_time'] != 0){
      6. $time = 0;
      7. $db->update("UPDATE %%USERS%% SET `bonus_attente_time` = ". $time .";");
      8. }
      9. if ($USER['bonus_attente_time'] > TIMESTAMP){
      10. $secsBonus = $USER['bonus_attente_time'] - TIMESTAMP;
      11. }
      Display All
      Here is the error message I get when I login as user:

      Source Code

      1. [b]Message: [/b]Undefined variable: db
      2. [b]File: [/b]/includes/pages/game/AbstractGamePage.class.php
      3. [b]Line: [/b]153
      4. [b]URL: [/b]https://XXX.XXX.XX/game.php
      5. [b]PHP-Version: [/b]5.6.40
      6. [b]PHP-API: [/b]fpm-fcgi
      7. [b]2Moons Version: [/b]1.8.git
      8. [b]Debug Backtrace:[/b]
      9. #0 /includes/pages/game/AbstractGamePage.class.php(153): errorHandler(8, 'Undefined varia...', 'FILEPATH ...', 153, Array)
      10. #1 /includes/pages/game/AbstractGamePage.class.php(184): AbstractGamePage->getNavigationData()
      11. #2 /includes/pages/game/AbstractGamePage.class.php(254): AbstractGamePage->getPageData()
      12. #3 /includes/pages/game/ShowOverviewPage.class.php(298): AbstractGamePage->display('page.overview.d...')
      13. #4 /game.php(57): ShowOverviewPage->show()
      14. #5 {main}
      Display All

      When I play as ADMIN, I can use the game. By click on BONUS i only get the message, that the refreshtime is not over.

      The post was edited 3 times, last by Vertex ().

    • I fixed the error.

      In AbstractGamePage.class.php is the variable db not set.
      So I edited in line 98, after this entry:

      Source Code

      1. $config = Config::get();


      the following code:


      Source Code

      1. $db = Database::get();


      Now the Bonus is working absolutely fine!!