PlayerJoin: Difference between revisions
No edit summary |
(Fixed some English, and updated border around Example) |
||
| Line 2: | Line 2: | ||
==Parameters== | ==Parameters== | ||
* '''player''' - player | * '''player''' - player which joined the server. | ||
==Example== | ==Example== | ||
This example outputs chat message, when player joins to the server. | This example outputs chat message, when player joins to the server. | ||
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;"> | |||
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div> | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
function playerJoinHandler(player) { | function playerJoinHandler(player) { | ||
| Line 13: | Line 15: | ||
mp.events.add("playerJoin", playerJoinHandler); | mp.events.add("playerJoin", playerJoinHandler); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | |||
==See also== | ==See also== | ||
[[Category:Player Events API]] | [[Category:Player Events API]] | ||
Revision as of 20:04, 18 September 2017
This event is triggered when a player joins the server.
Parameters
- player - player which joined the server.
Example
This example outputs chat message, when player joins to the server.
Server-Side
function playerJoinHandler(player) {
console.log(player.name + " join.");
}
mp.events.add("playerJoin", playerJoinHandler);