hi,
is there a way to recieve the index assigned to a user in the: smartFox.onUserEnterRoom() event, so that when a user joins a room, all the users present in the room get the index of the player assigned by the server. Actually i want to use this index for placing a player in my interface when he joins.
player index on onUserEnterRoom
-
- Posts: 5
- Joined: 15 May 2006, 18:14
Code: Select all
smartFox.onUserEnterRoom = function(roomId:Number, userObj:Object)
{
trace("ID: " + userObj.getId())
}
-
- Posts: 5
- Joined: 15 May 2006, 18:14
oh, i though tthat gave the user id and not player index , i just tried it, its returning me the userId, so like my user Id was 3 and i was the first player in my game room, then the second player to enter the room, when i getId() it, i get 4.. which is the user Id, i need the player id / player index (1,2,3... in a particular game room)
Last edited by alikapadia on 16 May 2006, 09:43, edited 1 time in total.
-
- Posts: 5
- Joined: 15 May 2006, 18:14
userId increments based on users connecting to smartfox, player index starts from 1 when a user joins a room and is the first player, and for the next entering player, the value increments by 1 regardless of user id. the feature that makes it ideal for me is that it fills up empty spaces between the indexes like in 3 users, player 2 exits, the next entering player is not assigned 3 but 2
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 76 guests