playMaker

Author Topic: Once Daily Logic [Solved]  (Read 2103 times)

MUX

  • Playmaker Newbie
  • *
  • Posts: 43
    • @stefstivala
Once Daily Logic [Solved]
« on: June 08, 2015, 06:50:02 PM »
Struggling with something relatively simple. i would like to reward my user with a bonus once daily after watching an ad.

what would be the best way to approach to check if a user has taken the reward bonus in the last 24 hours?
« Last Edit: June 13, 2015, 12:09:51 PM by MUX »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Once Daily Logic
« Reply #1 on: June 09, 2015, 01:39:21 AM »
Hi,

 You simply need to save today's date in the player prefs, and everytime the user watch an ad, you check if the date in the player prefs is today, if it is not, you offer a bonus and store the day, else you just say you have already bee awarded a bonus today or nothing.

use GetSystemDateTime to get the date in any format you want ('MM/dd/yyyy' will do for you, you don't care about the actual time).

 Bye,

 Jean