Ejemplo n.º 1
0
 void sendTranslation(string translation, params object[] args)
 {
     if (!getConfig().SendProtectionMessages)
     {
         return;
     }
     UnturnedChat.Say(Player, SpawnProtection.Instance.Translate(translation, args), SpawnProtection.GetProtMsgColor());
 }
Ejemplo n.º 2
0
        public void StopProtection(bool sendMessage = true)
        {
            ResetVariables();
            Player.Features.GodMode = false;
            var config = getConfig();

            if (config.GiveVanishWhileProtected && Player.Features.VanishMode)
            {
                Player.Features.VanishMode = false;
            }

            if (sendMessage && config.SendProtectionMessages)
            {
                UnturnedChat.Say(Player, SpawnProtection.Instance.Translate("expired"), SpawnProtection.GetProtMsgColor());
            }
        }
Ejemplo n.º 3
0
        void UnturnedPlayerEvents_OnPlayerUpdateGesture(UnturnedPlayer player, UnturnedPlayerEvents.PlayerGesture gesture)
        {
            if (player.CSteamID == Player.CSteamID)
            {
                if (gesture == UnturnedPlayerEvents.PlayerGesture.PunchLeft ||
                    gesture == UnturnedPlayerEvents.PlayerGesture.PunchRight)
                {
                    if (protectionEnabled)
                    {
                        StopProtection(false);

                        if (!getConfig().SendProtectionMessages)
                        {
                            return;
                        }
                        UnturnedChat.Say(Player, SpawnProtection.Instance.Translate("canceled_punch"), SpawnProtection.GetProtMsgColor());
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void StartProtection(bool sendMessage = true)
        {
            ResetVariables();

            protectionEnabled = true;
            protStart         = DateTime.Now;

            Player.GodMode = true;
            //spawnLocation = Player.Position;

            if (sendMessage && SpawnProtection.Config.SendProtectionMessages)
            {
                UnturnedChat.Say(Player, SpawnProtection.Instance.Translate("prot_started", SpawnProtection.Config.ProtectionTime), SpawnProtection.GetProtMsgColor());
            }
        }