I need to set the itemids value from my c# script in unity
handlers.additem = function(args){
var result = server.GrantItemsToUser(
{
PlayFabID: currentPlayerId,
CatalogVersion : "Equipamentos",
ItemIds : "1"
});
}
I need to set the itemids value from my c# script in unity
handlers.additem = function(args){
var result = server.GrantItemsToUser(
{
PlayFabID: currentPlayerId,
CatalogVersion : "Equipamentos",
ItemIds : "1"
});
}
To grant multiple items at once via GrantItemsToUser API, you may consider using the following request, due to property ItemIds is a list of string:
{ "PlayFabId": "{ {PlayFabId}}", "Annotation": "Entered Level 2", "ItemIds": [ "shield_level_3", "shield_level_4", "xxxxxxxxx" ] }
In addition, if you have many duplicated items, we suggest using ModifyItemUses API to directly change the number.
The problem is that I don't want to add multiple items, I want to add different items using the same script, since I have items that the only parameter that is different is the name (itemid), and everything else has the same parameter. For example: a sword that has STR and DEX, and an axe that also has STR and DEX, the only difference between them is the itemId, so when the item is created in my game, I send the parameters to the server, and I would like to be able to also send which item I'm sending the data to, using the itemID, but I couldn't find any way to do that other than create a new script for each game item
You may simply create a Cloud Script function, which will take the argument from the client to perform the action. If you are not familiar with Cloud Script, please refer to: https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript/quickstart
2 People are following this question.