question

steelfox001 avatar image
steelfox001 asked

SubtractUserVirtualCurrency

I want deduct Virtual Currency from Player, but

Cloud Script Deploy ok, Unity return error. :(

function PayUser() {

var SubtractUserVirtualCurrencyRequest = {

"PlayFabId" : currentPlayerId,

"VirtualCurrency" :"SL",

"Amount" : 20 };

var SubtractUserVirtualCurrency=

admin.SubtractUserVirtualCurrency(SubtractUserVirtualCurrencyRequest); }

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
steelfox001 avatar image
steelfox001 answered

ups.. finde mistake server.SubtractUserVirtualCurrency(SubtractUserVirtualCurrencyRequest)

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Correct - the Server API is available in Cloud Script, but not the Admin API. We'll be providing a way to use the Admin API in a scheduled task in a future update.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.