PlayerJoin: Difference between revisions
No edit summary |
|||
| Line 6: | Line 6: | ||
==Example== | ==Example== | ||
This example outputs chat message, when player joins to the server. | This example outputs chat message, when player joins to the server. | ||
<syntaxhighlight lang="javascript"> | |||
<syntaxhighlight lang="javascript | |||
function playerJoinHandler(player) { | function playerJoinHandler(player) { | ||
console.log(player.name + " join."); | console.log(player.name + " join."); | ||
| Line 17: | Line 13: | ||
mp.events.add("playerJoin", playerJoinHandler); | mp.events.add("playerJoin", playerJoinHandler); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 13:54, 10 January 2017
This event is triggered when a player joins the server.
Parameters
- player - player, which joined to the server.
Example
This example outputs chat message, when player joins to the server.
function playerJoinHandler(player) {
console.log(player.name + " join.");
}
mp.events.add("playerJoin", playerJoinHandler);