OnPlayerSpawn: Difference between revisions
From Onset Developer Wiki
Created page with "<syntaxhighlight lang="Lua"> function OnPlayerSpawn(player) end AddEvent("OnPlayerSpawn", OnPlayerSpawn) </syntaxhighlight>" |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Event|Server|1.0}} | |||
{{FuncDescription|Called when a player spawns. This usually happens after they died. Use [[SetPlayerRespawnTime]] to control how long it takes before they respawn.}} | |||
{{FuncSyntax|OnPlayerSpawn(player)}} | |||
{{FuncParameters}} | |||
{{FuncParam|player|The player who has spawned.}} | |||
== Example == | |||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
function OnPlayerSpawn(player) | function OnPlayerSpawn(player) | ||
Line 5: | Line 15: | ||
AddEvent("OnPlayerSpawn", OnPlayerSpawn) | AddEvent("OnPlayerSpawn", OnPlayerSpawn) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | |||
{{ServerEvents}} |
Revision as of 19:24, 22 March 2019
Description
Called when a player spawns. This usually happens after they died. Use SetPlayerRespawnTime to control how long it takes before they respawn.
Syntax
OnPlayerSpawn(player)
Parameters
- player
The player who has spawned.
Example
function OnPlayerSpawn(player)
end
AddEvent("OnPlayerSpawn", OnPlayerSpawn)
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