Internal Event :: playerSwitched

Availability:

SmartFoxServer PRO 1.6.6

Event name:

playerSwitched

Description:

This event is fired when a player is turned into a spectator in a game room. The event is available for both Zone Level and Room Level extensions. The switch is usually requested from the client side using the switchPlayer() request.

Properties:

name   description type
user   The User (object) that was turned into a player object

Example:

function handleInternalEvent(evtObj)
{
	if (evt.name == "playerSwitched")
	{
		var user = evt.user
		trace("User: " + user.getName() + " is now a spectator in this game!")
	}
}

See also: