-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWelcomePlugin.cs
More file actions
36 lines (30 loc) · 1.06 KB
/
Copy pathWelcomePlugin.cs
File metadata and controls
36 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Player;
using PlayerEvents = Exiled.Events.Handlers.Player;
namespace WelcomePlugin
{
public class WelcomePlugin : Plugin<Config>
{
public override string Name => "Welcome Plugin";
public override string Author => "Falous-Dev";
public override Version Version => new Version(1, 0, 0);
public override void OnEnabled()
{
PlayerEvents.Verified += OnPlayerVerified;
Log.Info("Welcome Plugin chargé avec succès!");
base.OnEnabled();
}
public override void OnDisabled()
{
PlayerEvents.Verified -= OnPlayerVerified;
Log.Info("Welcome Plugin désactivé!");
base.OnDisabled();
}
private void OnPlayerVerified(VerifiedEventArgs ev)
{
ev.Player.Broadcast(Config.Duration, Config.WelcomeMessage, shouldClearPrevious: true);
Log.Info($"Message de bienvenue envoyé à {ev.Player.Nickname}");
}
}
}