hello, the message ("Notification" by lang) when installing a workbench is displayed even to players without use permission, could you fix this? Thank you
"Notification" without permissionSolved
thanks, i do it myself :D
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.IsUnityNull())
{
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);
}
});
} Locked automatically