How do I use geolocation plugin to restrict showing ads.

Get help using Construct 2

Post » Thu Jun 25, 2015 8:27 am

Message: tomal2015 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Hi, I have been using construct 2 since 2013. Recently I'm facing a problem. The problem is I'm asked to make a game which will show some ads in a specific city. Outside of the city the ads won't pop up. Ads are hard-coded that means it is just another game object image with a company logo attached to it. So, how can I do that. I've searched stackflowover. I have found a solution but I can now implement it to my game. Here's the link.
B
2
Posts: 4
Reputation: 158

Post » Thu Jun 25, 2015 8:35 am

I guess the easiest way would be comparing if the geolocation values are within a square using the "system is between values"-condition..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jun 25, 2015 10:56 am

Thanks LittleStain for replying to this post I've made. Can you please help me with just one thing? How will I implement the expression of the geo-location in "system in between values" condition?
B
2
Posts: 4
Reputation: 158

Post » Thu Jun 25, 2015 11:16 am

Seems pretty straightforward

You want to compare if geolocation.longtitude is between a minimum number and a maximum number
and if geolocation.lattitude is between a minimum and a maximum number
if both these conditions are true you are within a certain square on the map..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jun 26, 2015 11:08 pm

https://freegeoip.net/

You can use this even in Construct with the AJAX object. Just call it with the IP in place and parse the result.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 19 guests