-
Notifications
You must be signed in to change notification settings - Fork 9
/
CommandHide.cs
52 lines (41 loc) · 1.74 KB
/
CommandHide.cs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using Rocket.API;
using Rocket.Unturned.Chat;
using Rocket.Unturned.Player;
using System.Collections.Generic;
using UnityEngine;
namespace NEXIS.Livemap
{
public class CommandLivemap : IRocketCommand
{
#region Properties
public AllowedCaller AllowedCaller => AllowedCaller.Player;
public bool AllowFromConsole => false;
public string Name => "hide";
public string Help => "This command toggles hiding your character location from the website Livemap.";
public List<string> Aliases => new List<string>() { };
public string Syntax => "/hide";
public List<string> Permissions => new List<string>() { "hide" };
#endregion
public void Execute(IRocketPlayer caller, params string[] command)
{
UnturnedPlayer player = (UnturnedPlayer)caller;
if (Livemap.Instance.Configuration.Instance.PlayerHidingEnabled)
{
// toggle player hide
if (Livemap.Instance.Nodes[player.CSteamID].Hidden)
{
Livemap.Instance.Nodes[player.CSteamID].Hidden = false;
UnturnedChat.Say(caller, Livemap.Instance.Translations.Instance.Translate("livemap_hidden_false"), Color.yellow);
}
else
{
Livemap.Instance.Nodes[player.CSteamID].Hidden = true;
UnturnedChat.Say(caller, Livemap.Instance.Translations.Instance.Translate("livemap_hidden_true"), Color.yellow);
}
}
else
UnturnedChat.Say(caller, Livemap.Instance.Translations.Instance.Translate("livemap_hidden_disabled"), Color.red);
}
}
}