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); } } } }
private bool IsInvisable(BasePlayer player) { if (Vanish == null) { return(false); } return(Vanish.Call <bool>("IsInvisible", player)); }
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)); } }
private void ToggleVanish(BasePlayer player) { if (Vanish == null) { return; } if (!IsInvisable(player)) { Vanish.Call("Disappear", player); } else { Vanish.Call("Reappear", player); } AdminGui(player); }
private void Init() { ins = this; permission.RegisterPermission(permAbilitiesInvulnerable, this); permission.RegisterPermission(permAbilitiesTeleport, this); permission.RegisterPermission(permAbilitiesHideWeapons, this); permission.RegisterPermission(permDamageAnimals, this); permission.RegisterPermission(permDamageBuildings, this); permission.RegisterPermission(permDamagePlayers, this); permission.RegisterPermission(permUse, this); AddLocalizedCommand("CommandVanish", "VanishCommand"); if (config.ImageUrlIcon == null) { config.ImageUrlIcon = "http://i.imgur.com/Gr5G3YI.png"; } Unsubscribe(); }
private void Init() { vanish = this; cachedVanishUI = CreateVanishUI(); // Register univeral chat/console commands AddLocalizedCommand(nameof(VanishCommand)); // Register permissions for commands permission.RegisterPermission(permallow, this); permission.RegisterPermission(permunlock, this); //permission.RegisterPermission(permdamage, this); permission.RegisterPermission(permavanish, this); //Unsubscribe from hooks UnSubscribeFromHooks(); if (!config.UseOnEntityTakeDamage) { _registeredhooks.Remove("OnEntityTakeDamage"); } if (!config.UseCanUseLockedEntity) { _registeredhooks.Remove("CanUseLockedEntity"); } foreach (var player in BasePlayer.activePlayerList) { if (!HasPerm(player.UserIDString, permavanish) || IsInvisible(player)) { continue; } Disappear(player); } }
private bool IsInvisible(BasePlayer player) { return(Vanish != null && Vanish.Call <bool>("IsInvisible", player)); }