Jump to content
MakeWebGames

Recommended Posts

Posted

Donators energy regen seems to vary between 12% and 17% for different users, does anyone know why this could be happening ?

There max energy is set to +2 for every level.

 

Cron for donators:

$query5="UPDATE users SET energy=energy+(maxenergy/(6.5)) WHERE energy<maxenergy AND donatordays>0";

  • 2 weeks later...
Posted

Re: Energy regen for donators

 

Donators energy regen seems to vary between 12% and 17% for different users, does anyone know why this could be happening ?

There max energy is set to +2 for every level.

 

Cron for donators:

$query5="UPDATE users SET energy=energy+(maxenergy/(6.5)) WHERE energy<maxenergy AND donatordays>0";

 

the reason for this is because the cron is updating the energy by a division and not %age

so if said user has 100 energy the cron would devide this by 6.5 = 15.38% per tick

and user 2 has 170 energy this would also be devived by 6.5 = 26.15% per tick

this is the part you need to look at and set your formula to

energy=energy+(maxenergy/(6.5)) = divides the max enery of a user by 6.5 then adds it = different %age per user

you could always try this

energy=energy+(maxenergy/(100)*20)) not sure if that is right but it should give 20% to all users (I am not a coder but good at mathematics)

forgot a ')'

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...