public static bool OpenYS_Command_Flight_Mortal_Method(Client ThisClient, CommandReader Command) { ThisClient.Vehicle.Invincible = false; ThisClient.SendMessage("You are no longer immortal! Watch out for enemy fire!"); Packets.Packet_30_AirCommand ResetStrength = new Packets.Packet_30_AirCommand(ThisClient.Vehicle.ID, "STRENGTH", ThisClient.Vehicle.CachedAircraft.STRENGTH.ToString()); Clients.LoggedIn.SendPacket(ResetStrength); return(true); }
public static bool OpenYS_Command_Flight_Immortal_Method(Client ThisClient, CommandReader Command) { Packets.Packet_36_WeaponsConfig Loading = ThisClient.Vehicle.WeaponsLoading; bool HasWeapons = false; #region Determine if Armed. foreach (ushort WeaponID in Loading.WeaponsInfo.Select(x => x.Weapon)) { switch (WeaponID) { case Packets.Packet_36_WeaponsConfig.WeaponTypes.AAM_Mid: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.AAM_Short: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.AAM_X: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.AGM: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.B250: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.B500: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.B500_HD: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.RKT: goto HasWeapons; case Packets.Packet_36_WeaponsConfig.WeaponTypes.FuelTank: //I am well aware a fuel tank isn't really a "weapon" but because it can be used as such we better disable it! Tough luck... goto HasWeapons; default: continue; HasWeapons: HasWeapons = true; continue; } } #endregion if (HasWeapons) { ThisClient.SendMessage("Can not make you immortal as you spawned with weapons loaded. Spawn again without weapons if you wish to be immortal!"); return(false); } //Not armed. ThisClient.Vehicle.Invincible = true; ThisClient.SendMessage("You are now immortal! Happy flying!"); Packets.Packet_30_AirCommand DisableGuns = new Packets.Packet_30_AirCommand(ThisClient.Vehicle.ID, "INITIGUN", "0"); Clients.LoggedIn.SendPacket(DisableGuns); return(true); }