Skip to content

Commit dad26f5

Browse files
committed
Fixed config
1 parent 47bdcce commit dad26f5

File tree

10 files changed

+24
-11
lines changed

10 files changed

+24
-11
lines changed

CommandHome.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
using Rocket.API;
1+
using System;
2+
using System.Collections.Generic;
3+
4+
using Rocket.API;
5+
using Rocket.Core.Logging;
26
using Rocket.Unturned.Commands;
37
using Rocket.Unturned.Player;
48
using SDG.Unturned;
59
using Steamworks;
610
using UnityEngine;
7-
using System;
8-
using System.Collections.Generic;
911

10-
namespace Zamirathe_HomeCommand
12+
namespace ZaupHomeCommand
1113
{
1214
public class CommandHome : IRocketCommand
1315
{
@@ -50,8 +52,12 @@ public List<string> Permissions
5052
public void Execute(IRocketPlayer caller, string[] bed)
5153
{
5254
UnturnedPlayer playerid = (UnturnedPlayer)caller;
53-
HomePlayer homeplayer = playerid.Player.transform.GetComponent<HomePlayer>();
55+
Logger.Log(playerid.IsAdmin.ToString() + " is admin");
56+
Logger.Log(playerid.Features.GodMode.ToString() + " is god mode");
57+
HomePlayer homeplayer = playerid.GetComponent<HomePlayer>();
58+
Logger.Log(homeplayer.name + " name");
5459
object[] cont = HomeCommand.CheckConfig(playerid);
60+
Logger.Log(cont[1].ToString());
5561
if (!(bool)cont[0]) return;
5662
// A bed was found, so let's run a few checks.
5763
homeplayer.GoHome((Vector3)cont[1], (byte)cont[2], playerid);

HomeGroups.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Xml.Serialization;
44

5-
namespace Zamirathe_HomeCommand
5+
namespace ZaupHomeCommand
66
{
77
public class HomeGroup
88
{

HomePlayer.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using Steamworks;
1313
using UnityEngine;
1414

15-
namespace Zamirathe_HomeCommand
15+
namespace ZaupHomeCommand
1616
{
1717
public class HomePlayer : UnturnedPlayerComponent
1818
{
@@ -27,13 +27,19 @@ public class HomePlayer : UnturnedPlayerComponent
2727
private byte bedRot;
2828
private UnturnedPlayer p;
2929

30-
private void Load()
30+
public void Awake()
31+
{
32+
Logger.Log("Homeplayer is awake");
33+
Console.Write("Homeplayer is awake.");
34+
}
35+
protected override void Load()
3136
{
3237
this.GoingHome = false;
3338
this.cangohome = false;
3439
}
3540
public void GoHome(Vector3 bedPos, byte bedRot, UnturnedPlayer player)
3641
{
42+
Logger.Log("starting gohome");
3743
this.waitrestricted = HomeCommand.Instance.Configuration.Instance.TeleportWait;
3844
this.movementrestricted = HomeCommand.Instance.Configuration.Instance.MovementRestriction;
3945
this.p = player;
@@ -97,6 +103,7 @@ public void GoHome(Vector3 bedPos, byte bedRot, UnturnedPlayer player)
97103
}
98104
private void DoGoHome()
99105
{
106+
Logger.Log("starting dogohome");
100107
if (!this.cangohome) return;
101108
UnturnedChat.Say(this.p, String.Format(HomeCommand.Instance.Configuration.Instance.TeleportMsg, this.p.CharacterName));
102109
this.p.Teleport(this.bedPos, this.bedRot);

ZaupHomeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using UnityEngine;
1212
using Steamworks;
1313

14-
namespace Zamirathe_HomeCommand
14+
namespace ZaupHomeCommand
1515
{
1616
public class HomeCommand : RocketPlugin<HomeCommandConfiguration>
1717
{

ZaupHomeCommandConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Rocket.API;
55
using Rocket.Core;
66

7-
namespace Zamirathe_HomeCommand
7+
namespace ZaupHomeCommand
88
{
99
public class HomeCommandConfiguration : IRocketPluginConfiguration
1010
{
@@ -21,7 +21,7 @@ public class HomeCommandConfiguration : IRocketPluginConfiguration
2121
public string UnableMoveSinceMoveMsg;
2222
public string NoTeleportDiedMsg;
2323

24-
public HomeCommandConfiguration()
24+
public void LoadDefaults()
2525
{
2626
Enabled = true;
2727
DisabledMsg = "I'm sorry {0}, but the home command has been disabled.";

lib/Assembly-CSharp.dll

0 Bytes
Binary file not shown.

lib/Rocket.API.dll

512 Bytes
Binary file not shown.

lib/Rocket.Core.dll

3.5 KB
Binary file not shown.

lib/Rocket.Unturned.dll

1.5 KB
Binary file not shown.

lib/Uconomy.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)