PlayerJoin: Difference between revisions
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
=='''Example'''== | =='''Example'''== | ||
This example outputs chat message, when player connect to the server. | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
function playerJoinHandler(player) { | function playerJoinHandler(player) { | ||
Revision as of 11:22, 28 December 2016
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 connect to the server.
function playerJoinHandler(player) {
console.log(player.name + " join.");
}
mp.events.add({
"playerJoin": playerJoinHandler
});