public void OnPlayerTeleport(Fougerite.Player player, Vector3 from, Vector3 dest) { if (RockGlitch) { var loc = player.Location; Vector3 cachedPosition = loc; RaycastHit cachedRaycast; cachedPosition.y += 100f; try { if (Physics.Raycast(loc, Vector3Up, out cachedRaycast, terrainLayer)) { cachedPosition = cachedRaycast.point; } if (!Physics.Raycast(cachedPosition, Vector3Down, out cachedRaycast, terrainLayer)) { return; } } catch { return; } if (!string.IsNullOrEmpty(cachedRaycast.collider.gameObject.name)) { return; } if (cachedRaycast.point.y < player.Y) { return; } Logger.LogDebug(player.Name + "intentó teletransportarse dentro de una roca. " + player.Location); Server.GetServer().Broadcast(player.Name + " intentó entrar dentro de una piedra."); foreach (Collider collider in Physics.OverlapSphere(player.Location, 3f)) { if (collider.gameObject.name == "SleepingBagA(Clone)") { TakeDamage.KillSelf(collider.GetComponent <IDMain>()); } } if (RockGlitchKill) { if (player.Admin) { player.Message("Usted es administrador y está autorizado a buguear las piedras."); return; } player.SendClientMessage("[color red]<Atención> No esta permitido buguear las piedras."); player.Kill(); } } }
public void KillPlayer(Fougerite.Player victim, Fougerite.Player myAdmin) { if (victim == myAdmin) { myAdmin.MessageFrom(Core.Name, yellow + "☢ " + red + "Suicide isn't painless. " + yellow + Core.Name + red + " won't let you kill yourself."); } else if (Administrator.IsAdmin(victim.UID) && !Administrator.GetAdmin(victim.UID).HasPermission("RCON")) { myAdmin.MessageFrom(Core.Name, yellow + "☢ " + red + "You can't kill: " + yellow + victim.Name + red + " he/she is an administrator."); } else { Administrator.NotifyAdmins(string.Format(yellow + "☢ " + green + "Player: " + yellow + "{1}" + green + " has been killed by " + yellow + "{0}" + green + ".", myAdmin.Name, victim.Name)); victim.Kill(); //TakeDamage.Kill(myAdmin.PlayerClient.netUser.playerClient, victim.PlayerClient.netUser.playerClient, null); } }
public void KillPlayer(Fougerite.Player victim, Fougerite.Player myAdmin) { if (victim == myAdmin) { myAdmin.MessageFrom(Core.Name, "Suicide isn't painless. " + Core.Name + " won't let you kill yourself."); } else if (Administrator.IsAdmin(victim.UID) && !Administrator.GetAdmin(victim.UID).HasPermission("RCON")) { myAdmin.MessageFrom(Core.Name, victim.Name + " is an administrator. May I suggest a rock?"); } else { Administrator.NotifyAdmins(string.Format("{0} killed {1} with mind bullets.", myAdmin.Name, victim.Name)); victim.MessageFrom(myAdmin.Name, string.Format("I killed you with mind bullets. That's telekinesis, {0}.", victim.Name)); victim.Kill(); //TakeDamage.Kill(myAdmin.PlayerClient.netUser.playerClient, victim.PlayerClient.netUser.playerClient, null); } }
public void OnPlayerTeleport(Fougerite.Player player, Vector3 from, Vector3 dest) { if (RockGlitch) { var loc = player.Location; Vector3 cachedPosition = loc; RaycastHit cachedRaycast; cachedPosition.y += 100f; try { if (Physics.Raycast(loc, Vector3Up, out cachedRaycast, terrainLayer)) { cachedPosition = cachedRaycast.point; } if (!Physics.Raycast(cachedPosition, Vector3Down, out cachedRaycast, terrainLayer)) return; } catch { return; } if (!string.IsNullOrEmpty(cachedRaycast.collider.gameObject.name)) return; if (cachedRaycast.point.y < player.Y) return; Logger.LogDebug(player.Name + " tried to TELEPORT rock glitch at " + player.Location); Server.GetServer().Broadcast(player.Name + " don't try to rock glitch =)"); foreach (Collider collider in Physics.OverlapSphere(player.Location, 3f)) { if (collider.gameObject.name == "SleepingBagA(Clone)") TakeDamage.KillSelf(collider.GetComponent<IDMain>()); } if (RockGlitchKill) { if (player.Admin) { player.Message("You administrator rights allowed you to bug inside rocks."); return; } player.Message("Glitching gets you killed."); player.Kill(); } } }
public void UseDrugOne() { if (CanUseDrugOne) { var inventory = FougeritePlayer.Inventory.InternalInventory; var inventoryItem = inventory.FindItem("Amphetamine"); if (inventoryItem != null) { int num = 1; if (inventoryItem.Consume(ref num)) { inventory.RemoveItem(inventoryItem.slot); } else { inventory.MarkSlotDirty(inventoryItem.slot); } inventoryItem.FireClientSideItemEvent(InventoryItem.ItemEvent.Used); } var compHealth = FougeritePlayer.Health - 35; if (compHealth >= 1) { FougeritePlayer.Health = compHealth; FougeritePlayer.PlayerClient.controllable.GetLocal <ClientVitalsSync>().SendClientItsHealth(); } else { FougeritePlayer.Kill(); SetDisplayOverlay(false); } MotorChange(); CanUseDrugOne = false; } }
public void HandleCollision(Fougerite.Player player) { if (player.SteamID != _spawnableObjectBehaviour.SpawnableObject.SteamID) { foreach (var rpcBehaviour in WorldEditorServer.RPCDictionary.Values) { rpcBehaviour.LandmineBehaviour_PlayParticleSystem(_spawnableObjectBehaviour .SpawnableObject.ID); } var compHealth = player.Health - _damageValue; if (compHealth <= 0) { player.Kill(); } else { player.Health = compHealth; player.PlayerClient.gameObject.GetComponent <ClientVitalsSync>().SendClientItsHealth(); } if (WorldEditorServer.LandmineCount.TryGetValue(_spawnableObjectBehaviour.SpawnableObject.SteamID, out var count)) { count--; WorldEditorServer.LandmineCount[_spawnableObjectBehaviour.SpawnableObject.SteamID] = count; if (Server.Cache.TryGetValue(ulong.Parse(_spawnableObjectBehaviour.SpawnableObject.SteamID), out var creatorPlayer)) { creatorPlayer.Notice("One of your landmines exploded! " + count + "/" + SpawnManager.MaxLandmineCount + " left!"); } } SpawnManager.RemoveObject(_spawnableObjectBehaviour.SpawnableObject.ID, false); } }
private IEnumerator ShootCoroutine() { while (true) { if (!_inRange) { yield return(new WaitForSeconds(1.5f)); continue; } if (_target == null) { _inRange = false; continue; } // Logger.Log("_target: " + _target); try { if (!_target.IsOnline) { _inRange = false; continue; } if (!RPCBehaviour._turretTargetDictionary.ContainsKey(_spawnableObjectBehaviour.SpawnableObject.ID)) { _inRange = false; continue; } // Logger.Log("Shooting at " + _target.Name); var compHealth = _target.Health - Damage; if (compHealth <= 0) { if (_target.PlayerClient.controllable != null) { _target.Kill(); _inRange = false; RPCBehaviour._turretTargetDictionary.Remove(_spawnableObjectBehaviour.SpawnableObject.ID); // Logger.Log("Killed."); } } else { _target.Health = compHealth; _target.Character.controllable.GetComponent <ClientVitalsSync>().SendClientItsHealth(); } } catch (Exception e) { Logger.Log("TurretBehaviour: Catched " + e); _inRange = false; } yield return(new WaitForSeconds(1f)); } }