SmartFoxServer Unity/.NET API
GetPlayerId Method
NamespacesSmartFoxClientAPI.DataUserGetPlayerId()()()
Retrieve the player id of the user.
The user must be a player inside a game room for this method to work properly.
This id is 1-based (player 1, player 2, etc.), but if the user is a spectator its value is -1.
Declaration Syntax
C#Visual BasicVisual C++
public int GetPlayerId()
Public Function GetPlayerId As Integer
public:
int GetPlayerId()
Return Value
The current player id
Remarks
Version:
SmartFoxServer Basic / Pro
Examples
CopyC#
Trace.WriteLine("The user's player id is " + user.GetPlayerId());

Assembly: SmartFoxClient (Module: SmartFoxClient) Version: 1.2.4.0 (1.2.4.0)