OnClientPlayerJoin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 36274 by MOJRM-511 (talk))
Line 11: Line 11:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function remotePlayerJoin()
function remotePlayerJoin()--فنكشن دخول اللاعب
outputChatBox("* " .. getPlayerName(source) .. " has joined the server")
outputChatBox("* " .. getPlayerName(source) .. " has joined the server")--اخراج نص ب الشات
end
end--انهاء الفنكشن
addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin)
addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin)--حدث دخول اللاعب
</syntaxhighlight>
</syntaxhighlight>



Revision as of 21:20, 26 September 2016

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("* " .. getPlayerName(source) .. " has joined the server")--اخراج نص ب الشات
end--انهاء الفنكشن
addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin)--حدث دخول اللاعب

See Also

Client player events


Client event functions