lucky3809 Posted September 12, 2011 Share Posted September 12, 2011 (edited) 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 September 12, 2011 by lucky3809 Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted September 12, 2011 Author Share Posted September 12, 2011 Can be deleted I found the solution to what I was needing help with, I just added an if statement with adding the exp and percent together then using the greater then 100... took me long enough lol. I was thinking you can't use + in an if statement, but it worked. Quote Link to comment Share on other sites More sharing options...
ShadyCoco Posted September 12, 2011 Share Posted September 12, 2011 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. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted September 13, 2011 Author Share Posted September 13, 2011 (edited) just seen the replies thank you guys! What i have done was if ($percent+$md['EXP']>=100){ //blah } And that worked for me. As for the mysql least() going to use that instead, that is what i was looking for but forgot the name for it thank you! Edited September 13, 2011 by lucky3809 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.