Exemple #1
0
 private void OnPlayerTick(BasePlayer player)
 {
     if (!UseParachutes)
     {
         return;
     }
     if (UseParachutes)
     {
         if (!AddParachute.ContainsKey(player.userID))
         {
             return;
         }
         if (AddParachute.ContainsKey(player.userID))
         {
             if (Chute != null)
             {
                 AddParachute.Remove(player.userID);
                 timer.Once(0.5f, () => Chute.Call("ExternalAddPlayerChute", player));
                 if (Vanish != null && UseAutoVanish)
                 {
                     timer.Once(0.5f, () => Vanish.Call("Reappear", player));
                 }
             }
             if (Chute == null)
             {
                 AddParachute.Remove(player.userID);
             }
         }
     }
 }
Exemple #2
0
 private bool IsInvisable(BasePlayer player)
 {
     if (Vanish == null)
     {
         return(false);
     }
     return(Vanish.Call <bool>("IsInvisible", player));
 }
Exemple #3
0
        private void cmdConsoleFlyHeli(ConsoleSystem.Arg arg)
        {
            BasePlayer player  = arg.Player();
            string     SteamID = player.userID.ToString();

            if (isAllowed(player, "heliride.allowed"))
            {
                var playerheli = player.GetComponent <FlyHelicopter>();

                if (HeliFlying.ContainsKey(player.userID))
                {
                    GameObject.Destroy(playerheli);
                    HeliFlying.Remove(player.userID);
                    if (Vanish != null && UseAutoVanish)
                    {
                        Vanish.Call("Reappear", player);
                    }
                    return;
                }
                if (playerheli != null)
                {
                    GameObject.Destroy(playerheli);
                    if (Vanish != null && UseAutoVanish)
                    {
                        Vanish.Call("Reappear", player);
                    }
                    HeliFlying.Remove(player.userID);
                    return;
                }

                if (playerheli == null)
                {
                    if (!player.IsFlying)
                    {
                        SendReply(player, lang.GetMessage("notflying", this, SteamID)); return;
                    }
                    if (Vanish != null && UseAutoVanish)
                    {
                        Vanish.Call("Disappear", player);
                    }
                    timer.Once(1f, () => AddHeli(player));
                    return;
                }
            }

            if (!isAllowed(player, "heliride.allowed"))
            {
                SendReply(player, lang.GetMessage("notallowed", this, SteamID));
            }
        }
Exemple #4
0
 private void ToggleVanish(BasePlayer player)
 {
     if (Vanish == null)
     {
         return;
     }
     if (!IsInvisable(player))
     {
         Vanish.Call("Disappear", player);
     }
     else
     {
         Vanish.Call("Reappear", player);
     }
     AdminGui(player);
 }
Exemple #5
0
 private bool IsInvisible(BasePlayer player)
 {
     return(Vanish != null && Vanish.Call <bool>("IsInvisible", player));
 }