OnClientPlayerJoin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(16 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This event is when a player joins. | {{Client event}} | ||
This event is triggered when a [[player]] joins a server. It is triggered for all players except the local player, as the local player joins the server before their client-side resources are started. It would also be possible for two players to join within a few seconds of each other and for the two players' scripts may not receive onClientPlayerJoin events as their scripts wouldn't have started yet. | |||
== | This event is not cancellable. | ||
==Parameters== | |||
''None'' | |||
==Source== | |||
The [[event system#Event source|source]] of this event is the [[player]] that joined the server. | |||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function remotePlayerJoin() | ||
outputChatBox("* " .. getPlayerName(source) .. " has joined the server") | |||
end | end | ||
addEventHandler ( " | addEventHandler("onClientPlayerJoin", root, remotePlayerJoin) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
===Client player events=== | |||
{{Client_player_events}} | |||
===Client event functions=== | |||
{{Client_event_functions}} |
Latest revision as of 20:43, 30 October 2024
This event is triggered when a player joins a server. It is triggered for all players except the local player, as the local player joins the server before their client-side resources are started. It would also be possible for two players to join within a few seconds of each other and for the two players' scripts may not receive onClientPlayerJoin events as their scripts wouldn't have started yet.
This event is not cancellable.
Parameters
None
Source
The source of this event is the player that joined the server.
Example
function remotePlayerJoin() outputChatBox("* " .. getPlayerName(source) .. " has joined the server") end addEventHandler("onClientPlayerJoin", root, remotePlayerJoin)
See Also
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled