• 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 Question Google Play Service

M.G.

Member
Hi,

I want to create the Google Leaderboard.

I have already set up everything in the google play console and everything installed.

The Code in GameMaker Studio 2:

obj_leaderboard

Create Event:

if !achievement_login_status()
{
achievement_login();
}

achievement_login();
global.PlayerName = "Anon";
global.PlayerID = -1;

Async - Social Event:

if ds_map_exists(async_load, "id")
{
switch(async_load[? "id"])
{
case achievement_our_info:
global.PlayerName = async_load[? "name"];
global.PlayerID = async_load[? "playerid"];
show_debug_message("GOOGLE SERVICES: User " + global.PlayerName + " with ID " + string(global.PlayerID) + " has logged in");
break;
}
}


When I start the game on my phone, I am connected to Google Play.

But I will not be logged in with my user account.

Does anyone know the error?
 
E

Etna Pixel

Guest
Hi,

I want to create the Google Leaderboard.

I have already set up everything in the google play console and everything installed.

The Code in GameMaker Studio 2:

obj_leaderboard

Create Event:

if !achievement_login_status()
{
achievement_login();
}

achievement_login();
global.PlayerName = "Anon";
global.PlayerID = -1;

Async - Social Event:

if ds_map_exists(async_load, "id")
{
switch(async_load[? "id"])
{
case achievement_our_info:
global.PlayerName = async_load[? "name"];
global.PlayerID = async_load[? "playerid"];
show_debug_message("GOOGLE SERVICES: User " + global.PlayerName + " with ID " + string(global.PlayerID) + " has logged in");
break;
}
}


When I start the game on my phone, I am connected to Google Play.

But I will not be logged in with my user account.

Does anyone know the error?
Pubblish Game on Beta Open in Google Play Dev Console! Set Tester Group and dowload our App from Play Store! After this passage Login Fix.
ObjController with achievement_login(); it must be the first object of the whole project! in addition you need to set the App Id on the Android / Social section and enable Google play service!
 
Top