Jump to content
MakeWebGames

Help with Percentage


lucky3809

Recommended Posts

I kind of having a difficult time with what i am trying to do, and just going to ask someone on here to see if they can direct me in the right area, or give me an example how i would do it.

Ok I made an education mod similar to roguevampires that has up to 3 modules per class everything is working the only problem I am having is on the last click I want it not go over 100% and want to add the completion text on the last click that would equal 100% for instance the 3rd module is 1.6% per click say the percentage is 99.8% done, I want the next click to read 100% and for it to read a message that it's complete instead of it reading 101.4%.

the code I am using for the percentage is the same exp and level uses in the check_level function with some adjustments made to fit the education table module instead of level and i erased the other things for will,brave,and ect.

would i just change the table field where exp is default 0.0 to 100.0?

Edited by lucky3809
Link to comment
Share on other sites

Hey.

I had a problem like this (somewhat).

 

Just make a max amount of EXP. eg:

$Max_EXP = $_MOD['LEVEL']*7+180

That would set the max.

Then in header have something like:

if ($_MOD['MyEXP'] => $Max_EXP) {

echo' gratz you have level'd up/ranked up';

mysql_query("UPDATE `mod` SET `EXP_NEED` = `0`");

}

its late and im not well so pm me and ill get back to you tomorrow or day after.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...