Ejemplo n.º 1
0
        public void Execute(IRocketPlayer caller, string[] bed)
        {
            UnturnedPlayer playerId   = (UnturnedPlayer)caller;
            HomePlayer     homePlayer = playerId.GetComponent <HomePlayer>();

            object[] cont = ZaupHomeCommand.CheckConfig(playerId);
            if (!(bool)cont[0])
            {
                return;
            }
            // A bed was found, so let's run a few checks.
            HomePlayer.CurrentHomePlayers.Add(playerId, homePlayer);
            homePlayer.GoHome((Vector3)cont[1], (byte)cont[2], playerId);
        }
Ejemplo n.º 2
0
        protected override void Load()
        {
            Instance   = this;
            waitGroups = new Dictionary <string, byte>();

            foreach (HomeGroup hg in Configuration.Instance.WaitGroups)
            {
                waitGroups.Add(hg.Id, hg.Wait);
            }


            UnturnedPlayerEvents.OnPlayerUpdatePosition += (player, position) =>
            {
                if (!HomePlayer.CurrentHomePlayers.ContainsKey(player) ||
                    !HomePlayer.CurrentHomePlayers[player].movementRestricted)
                {
                    return;
                }
                HomePlayer.CurrentHomePlayers[player].canGoHome = false;
                UnturnedChat.Say(player, string.Format(Instance.Configuration.Instance.UnableMoveSinceMoveMsg, player.CharacterName));
            };
        }