OnPlayerStreamIn

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
OnPlayerStreamIn

Type: Event
Context: Server & Client
Introduced: v1.0

Description

Called when another user is streamed in (rendered) for the player.

Syntax

OnPlayerStreamIn(player, otherplayer)
Client Syntax
OnPlayerStreamIn(otherplayer)

Parameters

  • player
    The player for the other player is streamed in.
  • otherplayer
    The player that streams in for player.

Example

A barebones example of syncing player clothing presets:

function OnPlayerStreamIn(player)
	-- Assuming `_modelPreset` is the player's clothing preset id,
	-- set their clothing so the client doesn't see them naked.
	local _modelPreset = GetPlayerPropertyValue(player, "_modelPreset")
	if (_modelPreset ~= nil and _modelPreset > 0) then
		SetPlayerClothingPreset(player, _modelPreset)
	end
end
AddEvent("OnPlayerStreamIn", OnPlayerStreamIn)

See also