Jamie Taylor - Director of Posted June 17, 2007 Share Posted June 17, 2007 The EXP level (in header.php) goes beyond 100% for some reason and is at... for instance 728% Why doesnt it stop at 100%? It has gone beyond this and ruined the design with a massive bar going off the page. Is there a fix? :-) Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design You could level them up at 100% :o Quote Link to comment Share on other sites More sharing options...
Jamie Taylor - Director of Posted June 17, 2007 Author Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design Excuse my ignorance... but how do I edit levels according to EXP? I can't find it! Quote Link to comment Share on other sites More sharing options...
Will Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design If you have changed someones exp and the bar is more than 100% then keep refreshing a page to keep running the "Check_level" code until it is below zero. Quote Link to comment Share on other sites More sharing options...
Draco Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design for display purposes you could also do check for 100% for example if($exp>100%) { $exp=100%; } *not a working fix, just an example, this wouldn't actually change their experience, it would just prevent the bar from going over 100% Quote Link to comment Share on other sites More sharing options...
hamster01 Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design won't the '%' give an error in php? Well, try this: $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $exopp=100-$experc; if ($experc > 100){ $var['exp'] = ($experc/100); list($exp,$the_rest) = burst('.',$var['exp']); echo '[img=bar.gif]X' . $exp; It works in theory. It will output: |__________|X5 Please correct me if i'm wrong. Quote Link to comment Share on other sites More sharing options...
Draco Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design yes it will, thats why I added that what i posted won't work just an eample for it work it would have to be more like the following if($exp > $expneeded) { $exp=$expneeded; } * This would return $exp as being 100% for displaying, like before this probably won't actually work on the game unless you change the variables to what you use and maybe some slight other modifications. It is just an example to point you in the right direction, hope it helps. Quote Link to comment Share on other sites More sharing options...
hamster01 Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design Sorry, while you posted i updated my post. but the variable expneeded, can also be more than 100. Quote Link to comment Share on other sites More sharing options...
Draco Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design in theory $expneeded shouldn't exceed 100%, it should always equal 100%. I may be wrong, but if $exp > $expneeded, then do the leveling stuff. . . with each level gained $expneeded raises for that account which creates a new 100% mark for that account. Just a note, i know $expneeded can be greater than 100 but I was using it like a percent. Basically calling $expneeded=100% of experience needed to level, so if $exp > $expneeded that means the $exp is greater than 100% of $expneeded. If I actually had the mc codes I could probably explain it more than what I did. It appears you have them so +1 on the assist ;) Both examples yield the same results, i think (not tested). Mine is just more generic, yours looks more workable on a live system Quote Link to comment Share on other sites More sharing options...
Jamie Taylor - Director of Posted June 17, 2007 Author Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design let me just get this straight - this glitch (btw refreshing the page works fine), only occurs when an admin changes the users exp, so its not a real issue right? Quote Link to comment Share on other sites More sharing options...
Draco Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design correct, it will (should) always right itself with a few page rerfreshes Quote Link to comment Share on other sites More sharing options...
hamster01 Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design If you attack someone much higher level than you this also happens. Quote Link to comment Share on other sites More sharing options...
Jamie Taylor - Director of Posted June 17, 2007 Author Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design I see, so this is really an issue... - so where in header.php would I add this display fix? Quote Link to comment Share on other sites More sharing options...
Draco Posted June 17, 2007 Share Posted June 17, 2007 Re: EXP level goes past 100% and breaks design around this line somewhere. . . $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); I don't own a version of mc codes, but that line is from the header of mccodes lite, can somebody else give better detail? Quote Link to comment Share on other sites More sharing options...
Jamie Taylor - Director of Posted June 18, 2007 Author Share Posted June 18, 2007 Re: EXP level goes past 100% and breaks design around this line somewhere. . . $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); I don't own a version of mc codes, but that line is from the header of mccodes lite, can somebody else give better detail? Anyone? :-D Quote Link to comment Share on other sites More sharing options...
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.