Sign In Register

How can we help you today?

Start a new topic
Answered

Creating/Deleting Teams from Cloud Code

Hi,


I would like to setup dynamic teams based on players location. The creation / joining / leaving and destruction of teams would not be handled by the players but by cloud code.


How can I access the team functionalities from an event?

I know I can get the existing teams:

https://docs.gamesparks.net/documentation/cloud-code-api/spark-cloud-code-api/sparkteams


But for "write" operations I'm seeing only request. Is there anyway to access those from cloud code?



Best Answer
Hey Stephane,

Once you have the team created, you can get that team using its id....

var team = Spark.getTeams().getTeam("team id");

From there you have access to all the features that SparkTeam object can do [docs here].
You can also create, join, leave or drop teams through the cloud code too [docs here].

Hope that helps,
-Sean




 


Answer
Hey Stephane,

Once you have the team created, you can get that team using its id....

var team = Spark.getTeams().getTeam("team id");

From there you have access to all the features that SparkTeam object can do [docs here].
You can also create, join, leave or drop teams through the cloud code too [docs here].

Hope that helps,
-Sean




 

Great ! I did not find those documentation pages before, that is exactly what I was looking for ! Thanks a lot :-)

Login to post a comment