-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCommandHome.cs
68 lines (64 loc) · 1.81 KB
/
CommandHome.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using Rocket.API;
using Rocket.Core.Logging;
using Rocket.Unturned.Commands;
using Rocket.Unturned.Player;
using SDG.Unturned;
using Steamworks;
using UnityEngine;
namespace ZaupHomeCommand
{
public class CommandHome : IRocketCommand
{
public string Name
{
get
{
return "home";
}
}
public string Help
{
get
{
return "Teleports you to your bed if you have one.";
}
}
public string Syntax
{
get
{
return "";
}
}
public List<string> Aliases
{
get { return new List<string>(); }
}
public List<string> Permissions
{
get { return new List<string>() { }; }
}
public AllowedCaller AllowedCaller
{
get
{
return AllowedCaller.Player;
}
}
public void Execute(IRocketPlayer caller, string[] bed)
{
UnturnedPlayer playerid = (UnturnedPlayer)caller;
Rocket.Core.Logging.Logger.Log(playerid.IsAdmin.ToString() + " is admin");
Rocket.Core.Logging.Logger.Log(playerid.Features.GodMode.ToString() + " is god mode");
HomePlayer homeplayer = playerid.GetComponent<HomePlayer>();
Rocket.Core.Logging.Logger.Log(homeplayer.name + " name");
object[] cont = HomeCommand.CheckConfig(playerid);
Rocket.Core.Logging.Logger.Log(cont[1].ToString());
if (!(bool)cont[0]) return;
// A bed was found, so let's run a few checks.
homeplayer.GoHome((Vector3)cont[1], (byte)cont[2], playerid);
}
}
}