Hello, im sorry, you check this topic?
https://umod.org/community/building-workbench/49057-notification-without-permission
even players without rights receive a notification when installing a workbench that the workbench works for the entire building
I will duplicate the code here, which I use after the last update, well, in that topic it was inserted crookedly :(
private void OnEntitySpawned(Workbench bench)
{
//Needs to be in NextTick since other plugins can spawn Workbenches
NextTick(() =>
{
BuildingData building = GetBuildingData(bench.buildingID);
building.OnBenchBuilt(bench);
UpdateBuildingPlayers(building);
if (!_pluginConfig.BuiltNotification)
{
return;
}
BasePlayer player = BasePlayer.FindByID(bench.OwnerID);
if (!player)
{
return;
}
if (!HasPermission(player, UsePermission))
{
return;
}
if (_notifiedPlayer.Contains(player.userID))
{
return;
}
_notifiedPlayer.Add(player.userID);
if (GameTipAPI == null)
{
if (!HasPermission(player, UsePermission))
{
return;
}
Chat(player, Lang(LangKeys.Notification, player));
}
else
{
GameTipAPI.Call("ShowGameTip", player, Lang(LangKeys.Notification, player), 6f);
}
});
}