Android Hourly Events
How would I be able to make an event happen every hour. I would be able to write the code, it's just finding out what I would need to make this work. I want to give the player £25 every hour.
Is it possible for me to get the system time or could I create a timer in game? I already have my money script and this is the code I will be using to add the money.
money += moneyAdd;
mngr.GetComponent<MoneyScript>().addMoney (5.5f);
Answer by Taxen0 · Feb 01, 2016 at 09:14 PM
I don't have any mobile dev experience but you could save the time the user last got paid in a variable (file), and whenever you start the app compare the times and give the X amount for each hour.
The user could of course cheat the system and change the time settings of the device to get extra money with this approach.
Otherwise you have to send the info to a database you own or use some other service that cant be manipulated to check the time, if there is one available.
hope this helps!
Your answer
Follow this Question
Related Questions
[Android] Push notification for an inactive player 1 Answer
How to make an App that only works for a week? 1 Answer
What is the best way to search a text clock UI for certain times 0 Answers
[Android] When App closed get time when player was gone? 1 Answer
What is the best way to implement a more responsive custom drag event with Scroll Rect? 0 Answers