give user money every 24 hours?
guilleface
Member Posts: 1,014
hi is still possible that the user can change the time and get this by changing the date? iam making a game that i want to give the user some money every 24 hours or the option to buy them, but can they hack this by changing the date or time?thanks
Comments
What you want to do is-
When the user opens the app, save the current date to an attribute. (Device->Clock->Day/Hour/Minute/etc)
Then, on subsequent openings, compare the current date to the saved date. If it's over 24 hours, give them the money, and set the new date to the new time. If not, don't do anything.
Of course, this method will give them the money 24 hours apart. If you wanted it "reset" at midnight, instead of changing the tracking attribute to the current time, set it to that days midnight.
Sorry if this sounded confusing, haven't had my coffee yet.
On a serious note, I don't think you can prevent someone from abusing the device time. If someone decides to reset their device date just to mess with your game, they're going to do it. Seems like a waste of... time... to me but to each his own.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User