How can I get the day of the week from the internet, only from the internet, not get the day of the week from the pc.
That is to say that even if the date of the PC is changed, continue to obtain it from the Internet.
Use AJAX to request URL "https://worldtimeapi.org/api/ip", you should receive JSON string containing all the information about current date, time, day of the week, timezone etc.
There are probably many similar services, just google them.
dop2000 I have done this:
construct.net/en/forum/construct-3/how-do-i-8/please-help-me-day-according-151791
but when the date of the pc is changed, the date of the game changes, and what I want is that nobody can cheat with it.
Develop games in your browser. Powerful, performant & highly capable.
I want that if the day is Sunday = variable day = 0, if the day is Monday = variable day = 1 .......
but day
only received from internet...
and what I want is that nobody can cheat with it.
And that's why I gave you the URL to get the date/time information from the internet.
dop2000 Sorry but I'm stupid, I don't know how to do it ...
Could you explain it a little more detailed :(
dropbox.com/s/pzhuot5i7779tn8/DOW_FromInternet.c3p
It's a Construct 3 project, you can open it in free version of C3. And then just copy everything to C2.
dop2000
it doesn't work for me, if it detects it but when I want to do something with the variable "currentday" it doesn't detect the day
the variable that you have given me as "D" I have it as "CUrrentDay", and when I want to do something like for example:
if it is currentDAy = 0 it activates a button
no work
I don't understand you. If it detects the day correctly in the variable, then the problem is with your code, not mine. Maybe you are checking the day too soon, you need to wait for the AJAX request to finish.
dop2000 Is there an alternative to WorldtimeAPI?, the website is down... :(
Yes:
programmableweb.com/category/time/api
dop2000 The easiest way to adapt it to my project?, I'm stupid
I never used any other servers, you need to do some research in Google.
You can try worldclockapi.com, it returns a simple JSON for a selected time zone:
http://worldclockapi.com/api/json/utc/now
Thank you dop2000 but that system returns dayofweek in letters, example "Saturday", in my game the variable is by numbers 0-6...
Just add 7 events that convert strings to numbers.
If DayString="Monday" then Set DayNumber=1 Else If DayString="Tuesday" then Set DayNumber=2 ...