OnPlayerSpawn: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
function OnPlayerSpawn(playerid) | function OnPlayerSpawn(playerid) | ||
AddPlayerChat(playerid, "You have spawned, is this a surprise?") | |||
end | end | ||
AddEvent("OnPlayerSpawn", OnPlayerSpawn) | AddEvent("OnPlayerSpawn", OnPlayerSpawn) | ||
Line 17: | Line 17: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[Template:ServerEvents]] | |||
* [[Template:ClientEvents]] |
Revision as of 19:55, 20 December 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(playerid)
Parameters
- playerid
The player who has spawned.
Example
function OnPlayerSpawn(playerid)
AddPlayerChat(playerid, "You have spawned, is this a surprise?")
end
AddEvent("OnPlayerSpawn", OnPlayerSpawn)