• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Android Please help me with IAP for andoid

A

AVUOX

Guest
I'm really stuck on how to program in IAP for google play and for some reason achievement_show_leaderboards and achievement_show_achievements isn't working even when signed into the google play services. Please help because I have been stuck with these problems for at least 5 months now and any answer would really help out a lot!
 
W

Waifu_Battle

Guest
I can help you implement leaderboard and achievment.
1.Set up your Achievements and Leaderboard on google play.
2.Make sure to add the Google Play Services Extension which you can download on the GMS Marketplace.
3.Go to Global Game Settings then Android / Fire tab.
4.Under the Android / Fire tab go to Social tab enable the Google Services
5. Add your App ID (generated on google play Ex:121645908905)
6.Go back to Game Maker create an object Ex:Achievments Button
7.on event Left Pressed put this code:
if os_is_network_connected()
{
if achievement_available()
{
achievement_show_achievements();
}
}

8. Create another object ,name what you want Ex: obj_achievment_list
9.Make a step event put this code:
if(global.myscore = 10)
{
if achievement_available() achievement_post('Put your achievement ID here Ex:CgkI16Lyn123456', 100)
}

Do this on Leaderboard as well.
Note: if your having trouble signing in you can make a button which will log you in
Ex:
if os_is_network_connected()
{
if (!achievement_login_status())
{
achievement_login()
}
}
 
A

AVUOX

Guest
Sorry for the late response but apparently (and i don't know how) my achievements will pop up and leaderboards too when i tap the respected icons, BUT do you need both a good internet connection and/or good service connection in order for the achievements and such to be loaded because i think that's what was causing it? Also I've tried searching everywhere on the internet for a guide on how to get these IAP to work but the guide was very misleading and gave very little guidance on how to get the IAP up and working. And I've also seen some problems with the whole, "Giving 'money' AFTER an AD is played" which no one seems to understand how that works, though I understand I didn't mention it was a problem above any advice on that would be much appreciated! Thanks for your time!

EDIT: I've messed with the GML for a few years but really never understood why you put this > ; at the end of a code line only reason being is I think its supposed to end the line of code its running but also when I took that symbol off of the achievement_login() code I was actually able to login then with it on.
 
Last edited by a moderator:
Top