OnPlayerStreamIn: Difference between revisions
From Onset Developer Wiki
m Updated description |
|||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
'''A barebones example of syncing player clothing presets:''' | |||
<syntaxhighlight lang="Lua> | |||
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) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{ServerEvents}} | {{ServerEvents}} |
Revision as of 18:45, 19 December 2019
Description
Called when another user is streamed in (rendered) for the player.
Syntax
OnPlayerStreamIn(player, otherplayer)
Client Syntax
OnPlayerStreamIn(player)
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
Player
- OnPlayerServerAuth
- OnPlayerSteamAuth
- OnPlayerDownloadFile
- OnPlayerStreamIn
- OnPlayerStreamOut
- OnPlayerPickupHit
- OnPlayerJoin
- OnPlayerQuit
- OnPlayerSpawn
- OnPlayerDeath
- OnPlayerWeaponShot
- OnPlayerDamage
- OnPlayerChat
- OnPlayerChatCommand
- OnPlayerInteractDoor
- OnPlayerChangeDimension
Vehicle
- OnPlayerEnterVehicle
- OnPlayerLeaveVehicle
- OnPlayerStateChange
- OnVehicleRespawn
- OnVehicleStreamIn
- OnVehicleStreamOut
- OnVehicleDamage
- OnVehicleChangeDimension
- OnVehicleCreated
- OnVehicleDestroyed
Game
Package
NPC
- OnNPCReachTarget
- OnNPCDamage
- OnNPCSpawn
- OnNPCDeath
- OnNPCStreamIn
- OnNPCStreamOut
- OnNPCChangeDimension
- OnNPCCreated
- OnNPCDestroyed
Object
- OnObjectStopMoving
- OnObjectChangeDimension
- OnObjectCreated
- OnObjectDestroyed
- OnObjectStreamIn
- OnObjectStreamOut