-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
33 lines (31 loc) · 972 Bytes
/
Plugin.cs
File metadata and controls
33 lines (31 loc) · 972 Bytes
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
using ClansTags;
using Qurre.API;
using Qurre.API.Attributes;
using Qurre.Events;
using Qurre.Events.Structs;
[PluginInit("ClansTags", "DaNoNe", "1.0.0")]
static class Plugin
{
[EventMethod(PlayerEvents.Join)]
static internal void JoinPlayerEvent(JoinEvent ev)
{
Player player = ev.Player;
foreach(string tag in Configs.ClansTags)
{
if (player.UserInfomation.Nickname.Contains($"[{tag}]"))
{
if(player.Administrative.RoleName == "")
{
player.Administrative.RoleName = $"{tag}";
} else
{
player.Administrative.RoleName = $"{tag} | {player.Administrative.RoleName}";
}
if (Configs.EnableJoinMessage)
{
Map.Broadcast(Configs.JoinMessage.Replace("%tag%", tag), Configs.TimeMessageDisplay);
}
}
}
}
}