OnClientPlayerJoin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function remotePlayerJoin()
function remotePlayerJoin()
outputChatBox("* " .. getPlayerName(source) .. " has joined the server")
outputChatBox("MOJRM-511 has joined the server")
end
end
addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin)
 
</syntaxhighlight>
</syntaxhighlight>



Revision as of 23:26, 1 June 2013

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.

Parameters

None

Source

The source of this event is the player that joined the server.

Example

function remotePlayerJoin()
	outputChatBox("MOJRM-511 has joined the server")
end

See Also

Client player events


Client event functions