SmartFoxServer Silverlight API
GetMyPlayerIndex Method
Namespaces ► SmartFoxClientAPI.Data ► Room ► GetMyPlayerIndex()()()
Retrieve the player id for the current user in the room.
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 Basic | Visual C++

    public int GetMyPlayerIndex()

    Public Function GetMyPlayerIndex As Integer

    public:
    int GetMyPlayerIndex()

Return Value
The player id for the current user
Remarks
Version:
SmartFoxServer Basic / Pro
Examples
CopyC#

    if (room.IsGame())
        Debug.WriteLine("My player id in this room: " + room.GetMyPlayerIndex());

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)