PlayerConnect
Tip
This event is available on server-side only
This event is called when a player connects.
Parameter | Description |
---|---|
player | The player that connected. |
reason | The reason the player connected with. |
Normal event handler
Alt.OnPlayerConnect += (player, reason) => {
// ...
}
Attribute event handler
Warning
Attribute event handlers only work in Scripts, or after executing Alt.RegisterEvents on a class instance.
For more info see: Create script
public class MyScript : IScript
{
[ScriptEvent(ScriptEventType.PlayerConnect)]
public void OnPlayerConnect(IPlayer player, string reason)
{
// ...
}
}