question

[not provided] avatar image
[not provided] asked

Search for player

I know this has been asked before, but I cant seem to find a specific answer. I was wondering what method I should use for querying for a specific player username (or ID or whatever it is thats used).

In this case, I would like to be able to search for a player and, when found, deduct one point (just an arbitrary score at the moment) from them.

Cheers

Player Data
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 answered

Since you're deducting a point (presumably from a statistic?), it sounds like you mean this to be a server-side call (Cloud Script?). For that, you could Server/GetUserAccountInfo, but since you're talking about updating a statistic, you may want to use Server/GetPlayerStatistics. Alternately, if it makes sense to set the player statistics to the "Sum" aggregation type, you could just call UpdatePlayerStatistics for that PlayFab ID, sending -1 as the value to add to the player's stat.

Generally speaking, you always have the PlayFab ID of the user(s) in question when you're operating on the server side. If you need to have a user enter a username, title display name, or email and look up the PlayFab ID, you can use Client/GetAccountInfo.

10 |1200

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

Saphal Aryal avatar image
Saphal Aryal answered

Does Anybody Have basic code to implement this feature?

10 |1200

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

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.