Nicholas Posted March 1, 2010 Share Posted March 1, 2010 hi everyone, im wondering... does anyone know how to make it so no matter what your max energy is, every 5 minutes you only get 5% energy (if non-donator) 8% energy (if donator) mysql_query("UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy < maxenergy AND donatordays=0"); mysql_query("UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy < maxenergy AND donatordays>0"); i cant figure it out... im not good with maths lol, i was thinking say you had 12 max energy. (which is level 1 character) i could get 5% energy every 5 minutes like this for a non-donator mysql_query("UPDATE users SET energy=energy+(maxenergy/(100*42)) WHERE energy<maxenergy AND donatordays=0"); that make like 5.04% energy... if you can do it like that with the /(100*42) but... then say you level up and get +1 max energy which be 13 energy and it has that /(100*42), you get 5.46% energy... can someone help please? NOTE: ive not tested this yet, dont wanna mess something up lol, so im asking professionals first Quote Link to comment Share on other sites More sharing options...
Djkanna Posted March 1, 2010 Share Posted March 1, 2010 Meh lemme work on a rough idea... Right: How about multiplying the number by ten to start. Then dividing it by 500 for nonD's And divide it by 200 for Don's Max energy = 13 *10 = 130 130/500 = 0.26 130/200 = 0.65 *10/500 = nonD's *10/200 = Don's Seems releativly evil to me but it will keep training ect down so no one person ahead and others having no chance of catching up. ==TBC== Quote Link to comment Share on other sites More sharing options...
Analog Posted March 1, 2010 Share Posted March 1, 2010 If your just doing a straight percent you could convert it to a decimal. 100% = 1, so 5% would be 0.05 then you could use energy = energy + (maxenergy * 0.05) Quote Link to comment Share on other sites More sharing options...
Nicholas Posted March 2, 2010 Author Share Posted March 2, 2010 how would you convert it to a decimal mate? Quote Link to comment Share on other sites More sharing options...
chaoswar4u Posted March 2, 2010 Share Posted March 2, 2010 For the most accurate results use decimal as suggested as small percentage increases at say level 1 will not work due to the figure being low thus being rounded off to zero. If set to store as decimal will store the figure exactly. 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.