public static void Run(SvPlayer player, string message) { string arg1 = GetArgument.Run(1, false, true, message); if (string.IsNullOrEmpty(arg1)) { arg1 = player.player.username; } var currPlayer = GetShByStr.Run(arg1); if (currPlayer == null) { player.SendChatMessage(NotFoundOnline); return; } ReadFile.Run(GodListFile); var msg = $"<color={infoColor}>Godmode</color> <color={argColor}>{{0}}</color> <color={infoColor}>for</color> <color={argColor}>'{arg1}'</color><color={infoColor}>.</color>"; if (GodListPlayers.Contains(currPlayer.username)) { RemoveStringFromFile.Run(GodListFile, currPlayer.username); ReadFile.Run(GodListFile); player.SendChatMessage(string.Format(msg, "disabled")); return; } File.AppendAllText(GodListFile, currPlayer.username + Environment.NewLine); GodListPlayers.Add(currPlayer.username); player.SendChatMessage(string.Format(msg, "enabled")); }
public static bool HitEffect(ShRestraint restraint, ref ShDestroyable hitTarget, ref ShPlayer source, ref Collider collider) { var shPlayer = hitTarget as ShPlayer; if (!shPlayer || shPlayer.IsDead()) { return(true); } if (!PlayerList.TryGetValue(hitTarget.ID, out var hitPlayer)) { return(false); } if (!GodListPlayers.Contains(hitPlayer.ShPlayer.username)) { return(false); } hitPlayer.ShPlayer.svPlayer.SendChatMessage("<color=#b7b5b5>Being handcuffed Blocked!</color>"); return(true); }
public static bool Run(SvPlayer player, float?amount = null, string customMessage = null) { try { if (GodListPlayers.Contains(player.playerData.username)) { if (amount != null && ShowDMGMessage) { player.SendChatMessage($"<color=#b7b5b5>{amount} DMG Blocked!</color>"); } if (customMessage != null) { player.SendChatMessage(customMessage); } return(true); } } catch (Exception ex) { ErrorLogging.Run(ex); } return(false); }