void cmdKillPlayer(NetUser netuser, string command, string[] args) { if (!permission.UserHasPermission(netuser.playerClient.userID.ToString(), "advmetabolism.allowed")) { SendReply(netuser, GetMessage("NoPermissionKill", netuser.userID.ToString())); return; } else if (args.Length != 1) { var rootControllable = netuser.playerClient.rootControllable; if (!rootControllable) { return; } var rootCharacter = rootControllable.rootCharacter; if (!rootCharacter) { return; } Metabolism metabolism = rootControllable.GetComponent <Metabolism>(); metabolism.AddRads(99999999); netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode(false); SendReply(netuser, GetMessage("KillSelf", netuser.userID.ToString())); return; } else { NetUser targetuser = rust.FindPlayer(args[0]); if (targetuser != null) { var rootControllable = targetuser.playerClient.rootControllable; if (!rootControllable) { return; } var rootCharacter = rootControllable.rootCharacter; if (!rootCharacter) { return; } Metabolism metabolism = rootControllable.GetComponent <Metabolism>(); metabolism.AddRads(99999999); targetuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode(false); SendReply(netuser, GetMessage("KillTargetReply", netuser.userID.ToString()) + targetuser.displayName); SendReply(targetuser, GetMessage("KillTargetMessage", netuser.userID.ToString()) + netuser.displayName); } } }
void cmdEp250(NetUser netuser, string command, string[] args) { var id = netuser.userID.ToString(); if (!arenassystem) { rust.SendChatMessage(netuser, chatPrefix, GetMessage("ArenasOffline", id)); return; } if (locationsTeleports.Count == 0) { rust.SendChatMessage(netuser, chatPrefix, GetMessage("ArenasOffline", id)); return; } if (online.ContainsKey(netuser)) { if (online[netuser]) { online[netuser] = false; PlayersInP250.Add(netuser.playerClient.gameObject.AddComponent <P250arena>()); Arena(netuser); } else { online[netuser] = true; GameObject.Destroy(netuser.playerClient.GetComponent <P250arena>()); PlayersInP250.Remove(netuser.playerClient.GetComponent <P250arena>()); var rootControllable = netuser.playerClient.rootControllable; Metabolism morte = rootControllable.GetComponent <Metabolism>(); morte.AddRads(999999999999); } } else { online[netuser] = false; PlayersInP250.Add(netuser.playerClient.gameObject.AddComponent <P250arena>()); Arena(netuser); } }