Täglicher Bonus Script

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

  • Täglicher Bonus Script

    Hallo zusammen,

    erstmal freut es mich das Ihr wieder online seit :)

    Ich habe hier ein script wo ich leider nicht weiter komme, dies soll alle 12 Stunden ein Bonus von 100DM geben.
    Das hinzufügen des Bonus funktioniert doch leider wird die Ablaufzeit/Countdown nicht hinzugefügt
    vielleicht hat ja jemand ne lösung dafür
    das wäre echt Super

    Spielversion ist 1.8

    PHP Source Code

    1. <?php
    2. class ShowDMBonusPage extends AbstractGamePage
    3. {
    4. public static $requireModule = 0;
    5. function __construct()
    6. {
    7. parent::__construct();
    8. }
    9. function show()
    10. {
    11. global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
    12. $this->tplObj->loadscript('countdown.js');
    13. if(!empty($USER['urlaubs_modus'])){
    14. $this->printMessage("Du bist leider im Urlaubsmodus!", true, array('game.php?page=DMBonus', 2));
    15. die();
    16. }
    17. $time = "12 Stunden";
    18. $ship1 = 100;
    19. $cost = 1;
    20. if($_POST){
    21. if($USER['darkmatter'] >= $cost){
    22. if($USER['dm_bonus_time']+12*60*60 < TIMESTAMP){
    23. $USER['darkmatter'] -= $cost;
    24. $USER['darkmatter'] += $ship1;
    25. $sql = "UPDATE %%USERS%% set dm_bonus_time = '".TIMESTAMP."' +12*60*60 WHERE id = :userID;";
    26. $this->printMessage("Erfolgreich erhalten!", true, array('game.php?page=DMBonus', 2));
    27. die();
    28. }
    29. else{
    30. $this->printMessage("Erhältlich alle 12 Stunden!", true, array('game.php?page=DMBonus', 2));
    31. die();
    32. }
    33. }
    34. else{
    35. $this->printMessage("Du hast leider nicht genug Dunkle Materie!", true, array('game.php?page=DMBonus', 2));
    36. die();
    37. }
    38. }
    39. $this->tplObj->assign_vars(array(
    40. 'cost' => pretty_number($cost),
    41. 'time' => $time,
    42. 'status' => ((($USER['dm_bonus_time']+12*60*60) < TIMESTAMP) ? true : (($USER['dm_bonus_time']+12*60*60) - TIMESTAMP)),
    43. 'ship1' => pretty_number($ship1),
    44. ));
    45. $this->display('page.DMbonus.default.tpl');
    46. }
    47. }
    48. ?>
    Display All