Error after this wipe

Hi :-)

Just a heads-up: luckily, this error appears after todays update:
NoSash - Failed to compile: No overload for 'OnItemAddedRemoved' matches delegate 'Action<Item, bool, BasePlayer>' | Line: 23, Pos: 74

Thank you so much <3

I came here to see if anyone else posted, but I highly doubt we will get an update on this.

Action<Item, bool, BasePlayer>更新Action多了一个参数BasePlayer,

把private void OnItemAddedRemoved(Item item, bool added)

改为

private void OnItemAddedRemoved(Item item, bool added, BasePlayer APlayer)

自杀后就可以看到效果了

Fix from Claude:
How to fix the NoSash compile error ("No overload for 'OnItemAddedRemoved' matches delegate 'Action<Item, bool, BasePlayer>'")

A Rust update changed the inventory event so it now passes a third value, the player. The plugin's handler needs updating to match. Open NoSash.cs in a text editor and make the following changes.

Step 1 (required, fixes the error): Near the bottom of the file, find the line "private void OnItemAddedRemoved(Item item, bool added)" and change it to "private void OnItemAddedRemoved(Item item, bool added, BasePlayer player)". Then, inside that same method, find the line "BasePlayer player = item?.parent?.playerOwner;" and replace it with these four lines:

if (player == null)
{
player = item?.parent?.playerOwner;
}

You must replace that line rather than keep it, because "player" is now supplied by the method itself and declaring it a second time will cause a new error.

Step 2 (optional, stops duplicate handlers when a player respawns): In the OnPlayerSpawn method, find the three lines ending in "+= OnItemAddedRemoved;". Directly above them, add these three lines:

player.inventory.containerBelt.onItemAddedRemoved -= OnItemAddedRemoved;
player.inventory.containerMain.onItemAddedRemoved -= OnItemAddedRemoved;
player.inventory.containerWear.onItemAddedRemoved -= OnItemAddedRemoved;

Step 3 (optional, hides the sash as soon as a player spawns): Still in OnPlayerSpawn, directly after the three "+=" lines and before the closing brace of that block, add this line:

player.SetPlayerFlag(BasePlayer.PlayerFlags.DisplaySash, false);

Do not change the three "-=" lines in the Unload method; they will work once Step 1 is done. Save the file and the plugin will reload automatically.