You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For custom events see [Custom Events](https://fabianterhorst.github.io/coreclr-module/articles/custom-events.html).
4
+
5
+
Events can be registered via [scripts](https://fabianterhorst.github.io/coreclr-module/articles/create-script.html) or dynamically via event delegates.
6
+
This documentation is registering events via delegates dynamically.
7
+
8
+
To add for example a player connect event handler dynamically you can just add the delegate that will be called when a player connects.
9
+
10
+
This is a example using the lambda operator to add a event handler.
11
+
12
+
```csharp
13
+
Alt.OnPlayerConnect+= (player, reason) => {
14
+
Console.WriteLine($"{player.Name} connected.");
15
+
};
16
+
```
17
+
18
+
Its also possible to add a method instead of using a lambda. The method can be private, public, static ect.
0 commit comments