public void duty(UnturnedPlayer caller) { if (caller.IsAdmin) { caller.Admin(false); caller.Features.GodMode = false; caller.Features.VanishMode = false; if (Configuration.Instance.EnableServerAnnouncer) { UnturnedChat.Say(Instance.Translate("off_duty_message", caller.CharacterName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } } else { caller.Admin(true); if (Configuration.Instance.EnableServerAnnouncer) { UnturnedChat.Say(Instance.Translate("on_duty_message", caller.CharacterName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } } }
public void cduty(UnturnedPlayer cplayer, IRocketPlayer caller) { if (cplayer != null) { bool od = false; foreach (var pod in OnDuty_Players) { if (pod.Player.CSteamID == cplayer.CSteamID) { od = true; } } if (od) { if (Configuration.Instance.AllowDutyCheck) { if (caller is ConsolePlayer) { UnturnedChat.Say(Instance.Translate("check_on_duty_message", "Console", cplayer.DisplayName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } else if (caller is UnturnedPlayer) { UnturnedChat.Say(Instance.Translate("check_on_duty_message", caller.DisplayName, cplayer.DisplayName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } } else if (Configuration.Instance.AllowDutyCheck == false) { if (caller is UnturnedPlayer) { UnturnedChat.Say(caller, "Unable To Check Duty. Configuration Is Set To Be Disabled."); } } } else { if (Configuration.Instance.AllowDutyCheck) { if (caller is ConsolePlayer) { UnturnedChat.Say(Instance.Translate("check_off_duty_message", "Console", cplayer.DisplayName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } else if (caller is UnturnedPlayer) { UnturnedChat.Say(Instance.Translate("check_off_duty_message", caller.DisplayName, cplayer.DisplayName), UnturnedChat.GetColorFromName(Instance.Configuration.Instance.MessageColor, Color.red)); } } else if (Configuration.Instance.AllowDutyCheck == false) { if (caller is UnturnedPlayer) { UnturnedChat.Say(caller, "Unable To Check Duty. Configuration Is Set To Be Disabled."); } } } } else if (cplayer == null) { Rocket.Core.Logging.Logger.LogWarning("Duty Debug: Player is not online or his name is invalid."); if (caller is UnturnedPlayer) { UnturnedChat.Say(caller, "Player is not online or his name is invalid."); } } }