PlayerJoin: Difference between revisions
| Line 5: | Line 5: | ||
=='''Example'''== | =='''Example'''== | ||
<syntaxhighlight lang="javascript"> | <table> | ||
function playerJoinHandler(player) { | <thead> | ||
<tr> | |||
} | <th>Server-side</th> | ||
</tr> | |||
</thead> | |||
<tbody> | |||
<tr> | |||
<td> | |||
<syntaxhighlight lang="javascript"> | |||
function playerJoinHandler(player) { | |||
console.log(player.name + " join."); | |||
} | |||
mp.events.add({ | mp.events.add({ | ||
"playerJoin": playerJoinHandler | |||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</td> | |||
</tr> | |||
</tbody> | |||
</table> | |||
Revision as of 22:01, 27 December 2016
This event is triggered when a player joins the server.
Parameters
- player - player, which joined to the server.
Example
<thead> </thead> <tbody> </tbody>| Server-side |
|---|
function playerJoinHandler(player) {
console.log(player.name + " join.");
}
mp.events.add({
"playerJoin": playerJoinHandler
});
|