Joshua Posted September 29, 2009 Posted September 29, 2009 What would I have to do to have the EXACT Energy/Brave/will etc... number and % show up ie 90/100 90% I can't for the life of me figure it out. Thanks in advance. Quote
UltimaRatio Posted September 29, 2009 Posted September 29, 2009 Well, to be honest, I've never seen/worked/coded the McCode stuff..... So my "advice" is not exactly useful :P But, if you have a percent, you can easily convert it into a fraction out of 100(lets say).(percent already gives you a fraction out of 100) Ex: you have 9.65%; it is equal to 9.65 out of 100 (9.65/100) If you have the numbers, you can easily convert it into percents.(numerator divided by denominator = percent) Ex: now you have 25 whatever, your maximum is 100; 25 / 100 = 25% Don't get mad if it's not what you asked for :) And then, you can simply echo off both of them wherever you want. echo $stat[percent]."% || ".$stat[now]." / ".$stat[maximum]; where $stat is your variable with the energy/brave/etc; percent = %, now is what you have now, maximum is the maximum amount. Yeahhh.... ~Ultima P.S. I'm bored, so don't mind my childish explanation, don't have anything better to do. Quote
seanybob Posted September 29, 2009 Posted September 29, 2009 header.php You'll see something like: $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; Then further down: <LI>[b]Energy:[/b] {$enperc}% <a href=crystaltemple.php?spend=refill>[R]</a> [img=/images/endleft.gif][img=/images/barsilver.gif][img=/images/redbar.png][img=/images/endright.gif] <LI>[b]Will:[/b] {$wiperc}% [img=/images/endleft.gif][img=/images/barsilver.gif][img=/images/redbar.png][img=/images/endright.gif] <LI>[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']} [img=/images/endleft.gif][img=/images/barsilver.gif][img=/images/redbar.png][img=/images/endright.gif] <LI>[b]EXP:[/b] {$experc}% [img=/images/endleft.gif][img=/images/barsilver.gif][img=/images/redbar.png][img=/images/endright.gif] <LI>[b]Health:[/b] {$hpperc}% [img=/images/endleft.gif][img=/images/barsilver.gif][img=/images/redbar.png][img=/images/endright.gif] <hr /> EXP prints {$experc}%. Brave prints {$ir['brave']}/{$ir['maxbrave']}. The second is what you want. Use the variable in the first box to print. Example: EXP should print {$ir['exp']]/{$ir['exp_needed']}, not {$experc}% etc Quote
jds137 Posted September 30, 2009 Posted September 30, 2009 Nice to see people helping one another out for a change. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.