View Single Post
  #2310  
Old 10-08-2003, 01:41 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
i have the postbit stuff but not all of it is showing up. also i know you gain lvls/exp through posting but rpgpcp and postbit say the same thing no matter wut. so.... i need someone to help me fix it. i dont want to reinstall>_<
u dont know what I MEANT ? ohhhhh, poor me.
let's me say it again:
IF you want your status like HP, MP, AP, PP, EXP and your level show correctly in postbit after you gain EXP and/or level up. then YOU MUST, yes, sorry but i said you MUST update your stats by modify your profile and check the box "Update Stats" , then click the Submit Modifications button. After that, your things will be changed for sure.
And, Please Please make sure that you put in code in postbit all correct.
And, as I've mentioned above, you could let your stats auto up-to-date by doing the THIS:
Code:
In newreply.php and newthread.php, between

    // End Itemshop code by Mewtwo and Battle Code by Bitsys

and

    // send email to moderators

in both files, place the following code:

  //begin auto-update stats add-on for the RPG Integration Hack by Bitsys
    $userstats = $DB_site->query_first("SELECT inbattle, hp, maxhp, element, ma, maxma, pp, maxpp, ap, posts, xp FROM user WHERE userid='$bbuserinfo[userid]'");
    if ($userstats[inbattle] == 0) {
      //$debugmessage .= "You must be out of a battle in order to update your stats.  Please exit or complete battle $userinbattle[inbattle] and try again.";
      //exit;
      $extrastats = $DB_site->query_first("SELECT rpg_element.hp AS elehp, rpg_element.ma AS elema, rpg_element.pp AS elepp, rpg_element.ap AS eleap,
                                        battle_options.exprate, battle_options.hpmodifier, battle_options.mamodifier, battle_options.ppmodifier
                                        FROM battle_options, rpg_element
                                        WHERE rpg_element.elementid = $userstats[element]
                                        ");
      $hp = $userstats[hp];
      $maxhp = $userstats[maxhp];
      $ele = $userstats[element];
      $ma = $userstats[ma];
      $maxma = $userstats[maxma];
      $pp = $userstats[pp];
      $maxpp = $userstats[maxpp];
      $ap = $userstats[ap];
      $posts = $userstats[posts];
      $debugmessage .=  "HP: $hp | MaxHP: $maxhp | Element: $ele | MA: $ma | MaxMA: $maxma | PP: $pp | MaxPP: $maxpp | AP: $ap | Posts: $posts<br>\n";
      $jointime = (time() - $bbuserinfo[joindate]) / 86400;
      if ($jointime < 1) {
        $postsperday = "$posts";
      } else {
        $postsperday = sprintf("%.2f",($posts / $jointime));
      }
      $debugmessage .=  "Jointime: $jointime<br>\n";
      //$battleopt = $DB_site->query_first("SELECT * FROM battle_options");
        $level = getlevel($userstats[xp], $extrastats[exprate], 1);
        $ep = floor (100 * ($level - floor ($level)));
        $showlevel = floor ($level + 1);
      $debugmessage .=  "Level: $level | Showlevel: $showlevel<br>\n";
      $hpmulti =round ($postsperday / 4, 1);
      if ($hpmulti > 7.5)
        $hpmulti = 3;
      if ($hpmulti > 2.5)
        $hpmulti = 1.5;
      if ($hpmulti < 1)
        $hpmulti = 1;
      $debugmessage .=  "HPMulti: $hpmulti<br>\n";
      //$element = $DB_site->query_first("SELECT * FROM rpg_element WHERE elementid='$ele'");
      $hpmodifier = $extrastats[elehp];
      $mamodifier = $extrastats[elema];
      $ppmodifier = $extrastats[elepp];
      $apmodifier = $extrastats[eleap];
      $debugmessage .=  "HPmodifier: $hpmodifier | MAmodifier:  $mamodifier | PPmodifier: $ppmodifier | APmodifier: $apmodifier<br>\n";
      $maxhpupdate = ( $level * $extrastats[hpmodifier] * $hpmulti) + $hpmodifier;
      $maxhpupdate= floor ($maxhpupdate);
      $maxmaupdate = $mamodifier + ($jointime * $level * $extrastats[mamodifier]) / 5;
      $maxmaupdate = floor ($maxmaupdate);
      $maxppupdate = $ppmodifier + ($jointime * $level * $extrastats[ppmodifier]) / 3;
      $maxppupdate = floor ($maxppupdate);
      If ($maxhpupdate < 0)
        $maxhpupdate = 0;
      If ($maxmaupdate < 0)
        $maxmaupdate = 0;
      If ($maxppupdate < 0)
        $maxppupdate = 0;
      If ($apmodifier < 0)
        $apmodifier = 0;
      If ($maxhp != 0 && $maxhpupdate != 0)
        $newhp = $hp * ($maxhpupdate / $maxhp);
      else
        $newhp = $maxhpupdate;
      If ($maxma != 0 && $maxmaupdate != 0)
        $newma = $ma * ($maxmaupdate / $maxma);
      else
        $newma = $maxmaupdate;
      If ($maxpp != 0 && $maxppupdate != 0)
        $newpp = $pp * ($maxppupdate / $maxpp);
      else
        $newpp = $maxppupdate;
      $debugmessage .=  "MaxHPupdate: $maxhpupdate | MaxMAupdate: $maxmaupdate | MaxPPupdate: $maxppupdate<br>\n";
      $debugmessage .=  "NewHP: $newhp | NewMA: $newma | NewPP: $newpp<br>\n";
      $DB_site->query("UPDATE user SET maxhp='$maxhpupdate', hp='$newhp', maxma='$maxmaupdate', ma='$newma', maxpp='$maxppupdate', pp='$newpp' WHERE userid='$bbuserinfo[userid]'");

      $debugmessage .=  "Stats Updated.";
    } else {
      $debugmessage .=  "You are in Battle.";
    }

    //end auto-update stats add-on for the RPG Integration Hack by Bitsys



That's it!
P.S: this is going to be my last time to guide u something very easy understanding like this, sorry, but if go on, I'll go MAD
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,800KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete