Sign In Register

How can we help you today?

Start a new topic

get player is online

Hi,


 I want to know when a user is online,

what happens to me is that it detects me well the first time, but it is not updated,

if the friend closes the game he keeps telling me that he is connected,

I call an event every 5 seconds

-----------------------------------

var Id = Spark.getData().ID;


var friendPlayer = Spark.loadPlayer(Id.toUpperCase());

var friendOnline = friendPlayer.isOnline();

    

var currentOnline = {

    "online" : friendOnline,

}; 


Spark.setScriptData("ONLINEPLAYER", currentOnline);

-----------------------------------

thanks


Login to post a comment