Sign In Register

How can we help you today?

Start a new topic
Answered

getting other player's location data

how to get access to location data of  other participants's in a match ?

looking for this part of data:

"location":{"country":"BD","latitide":23.699996948242188,"city":null,"longditute":90.375},


Best Answer

Hi Ahsan,


To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.

  

var request = new SparkRequests.AccountDetailsRequest();
var response = request.SendAs(playerID); //playerID = the id of the player you want the details for.
    
Spark.setScriptData("Location", response.location)

 


Thanks,

Liam 

1 Comment

Answer

Hi Ahsan,


To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.

  

var request = new SparkRequests.AccountDetailsRequest();
var response = request.SendAs(playerID); //playerID = the id of the player you want the details for.
    
Spark.setScriptData("Location", response.location)

 


Thanks,

Liam 

Login to post a comment