OnPlayerSpawn: Difference between revisions
From Onset Developer Wiki
No edit summary |
mNo edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
{{FuncDescription|Called when a player spawns. This usually happens after they died. Use [[SetPlayerRespawnTime]] to control how long it takes before they respawn.}} | {{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( | {{FuncSyntax|OnPlayerSpawn(playerid)}} | ||
{{FuncSyntaxClient|OnPlayerSpawn()}} | |||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam| | {{FuncParam|playerid|The player who has spawned.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
function OnPlayerSpawn( | function OnPlayerSpawn(playerid) | ||
AddPlayerChat(playerid, "You have spawned, is this a surprise?") | |||
end | end | ||
AddEvent("OnPlayerSpawn", OnPlayerSpawn) | AddEvent("OnPlayerSpawn", OnPlayerSpawn) | ||
Line 17: | Line 18: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{ | {{PlayerEvents}} |
Latest revision as of 08:03, 16 January 2020
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)
Client Syntax
OnPlayerSpawn()
Parameters
- playerid
The player who has spawned.
Example
function OnPlayerSpawn(playerid)
AddPlayerChat(playerid, "You have spawned, is this a surprise?")
end
AddEvent("OnPlayerSpawn", OnPlayerSpawn)
See also
- OnPlayerServerAuth
- OnPlayerSteamAuth
- OnPlayerStreamIn
- OnPlayerStreamOut
- OnPlayerJoin
- OnPlayerQuit
- OnPlayerSpawn
- OnPlayerDeath
- OnPlayerWeaponShot
- OnPlayerDamage
- OnPlayerChat
- OnPlayerChatCommand
- OnPlayerInteractDoor
- OnPlayWeaponHitEffects
- OnPlayerSwitchCamera
- OnPlayerEnterWater
- OnPlayerLeaveWater
- OnPlayerCrouch
- OnPlayerEndCrouch
- OnPlayerEndFall
- OnPlayerFall
- OnPlayerTalking