0
Good morning guys! I’m creating a little role-playing game and I’m not figuring out how to get it to heal the x user in x minutes. I managed to do via ajax, but it’s not safe right? Easily the user can cheat and heal his whole life if he wants... Is there any way to do this without ajax? In the database I already have all the values, life, maximum life etc... Give me a strength! Thanks.
@EDIT with ajax although until it worked, the user needed to be logged in to work, it would also be something that he did not need to log in... that the system works even if it turned off.
Search on Cron, or something like that, the servers usually provide "chronometers" to perform scheduled tasks, you can leave a php file already done to "heal" the players, and use the scheduled tasks to run that file. I’m just not sure how little time they run..
– Fleuquer Lima
Um I think I’ve seen something about it on my host... I’m going to do some research. @EDIT found, my host has advanced cron tasks option, where it can run php file every 60 seconds, which is the minimum time. Thanks for the help, I’ll leave the question open for a while to see if they give some other ideas! :)
– Raizant
Good that you thought, is that I already had to do it for a RPG game that I had created. At the time this was the best solution I could find. Any doubt can speak
– Fleuquer Lima
Just to understand... you will send something to php or just run a file that is already there?
– zwitterion
I’m currently using cron... It runs php with the script that heals if life is below the maximum limit...
– Raizant