public static void sendHatAssignments() { // Send hat assignments for each player foreach (PlayerControl player in PlayerControl.AllPlayerControls) { uint hatId = hatAssignments[player.PlayerId]; // Set for host if (player.PlayerId == PlayerControl.LocalPlayer.PlayerId) { AlternativeRpcSender.RpcSetHat(hatId); } // Send to other players CustomRpcSender.RpcHostSetHat(player.PlayerId, hatId); } }
// Handling of mod activation / deactivation private static void ModActiveValueChanged(object sender, OptionValueChangedEventArgs e) { // Communicate change to other players if (AmongUsClient.Instance.AmHost) { CustomRpcSender.RpcSetModActive(ModActive.GetValue()); } // Handle it ourselfes if (ModActive.GetValue()) { modActivated(); } else { modDeactivated(); } }
// Handling of skin activation / deactivation private static void SkinsAllowed_ValueChanged(object sender, OptionValueChangedEventArgs e) { // Communicate change to other players if (AmongUsClient.Instance.AmHost) { CustomRpcSender.RpcSetSkinsAllowed(SkinsAllowed.GetValue()); } // Handle it ourselfes if (SkinsAllowed.GetValue()) { skinsActivated(); } else { skinsDeactivated(); } }