-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandFobInfo.cs
More file actions
69 lines (60 loc) · 2.58 KB
/
CommandFobInfo.cs
File metadata and controls
69 lines (60 loc) · 2.58 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using Rocket.API;
using Rocket.Unturned.Chat;
using Rocket.Unturned.Player;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using UnityEngine;
namespace Ekin.EACFOB
{
internal class CommandFobInfo : IRocketCommand
{
public AllowedCaller AllowedCaller => AllowedCaller.Player;
public string Name => "fobinfo";
public string Help => "";
public string Syntax => "";
public List<string> Aliases => new List<string>();
public List<string> Permissions => new List<string>();
public void Execute(IRocketPlayer caller, string[] command)
{
UnturnedPlayer player = (UnturnedPlayer)caller;
if (command.Length < 1)
{
UnturnedChat.Say(caller, "How to use: /fobinfo <fobname/id>");
return;
}
var INST = EACFOBPlugin.Instance;
string fobname = command[0];
if (INST.Fobs.ContainsKey(fobname))
{
var fobinfo = INST.Fobs[fobname];
UnturnedChat.Say(caller, fobname + " INFO:", Color.yellow);
UnturnedChat.Say(caller, "Fob Created by : " + fobinfo.Owner, Color.white);
UnturnedChat.Say(caller, "Fob Team : " + fobinfo.Type, Color.white);
UnturnedChat.Say(caller, "Fob ID : " + fobinfo.InstanceID, Color.white);
UnturnedChat.Say(caller, "Fob Location : " + fobinfo.Location, Color.white);
return;
}
var match = INST.Fobs.FirstOrDefault(pair => pair.Value.InstanceID.ToString() == fobname);
if (!match.Equals(default(KeyValuePair<string, FobData>)))
{
var fobinfo = match.Value;
UnturnedChat.Say(caller,"Listed By ID:", Color.gray);
UnturnedChat.Say(caller, fobinfo.Name + " INFO:",Color.yellow);
UnturnedChat.Say(caller, "Fob Created by : " + fobinfo.Owner, Color.white);
UnturnedChat.Say(caller, "Fob Team : " + fobinfo.Type, Color.white);
UnturnedChat.Say(caller, "Fob ID : " + fobinfo.InstanceID, Color.white);
UnturnedChat.Say(caller, "Fob Location : " + fobinfo.Location, Color.white);
return;
}
else
{
UnturnedChat.Say(caller, "Failed to find " + fobname + " Fob.", Color.red);
return;
}
}
}
}