C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using System.Collections.Generic;
using Oxide.Core.Libraries.Covalence;
namespace Oxide.Plugins
{
[Info("Announcer", "Wulf/lukespragg", "0.2.0", ResourceId = 0)]
[Description("Broadcasts customizable messages when players join/quit")]
class Announcer : CovalencePlugin
{
// Do NOT edit this file, instead edit the default Announcer.en.json in oxide/lang,
// or create a language file for another language using the 'en' file as a default.#region Localization
void Init()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["PlayerJoined"] = "{0} joined the survivors",
["PlayerQuit"] = "{0} abandoned the survivors"
}, this);
}
#endregion
#region Broadcast Messages
void OnUserConnected(IPlayer player) => server.Broadcast(Lang("PlayerJoined", player.Id, player.Name));
void OnUserDisconnected(IPlayer player) => server.Broadcast(Lang("PlayerQuit", player.Id, player.Name));
#if HURTWORLD
bool OnConnectionNotice() => true;
bool OnDisconnectionNotice() => true;
#endif
#endregion
#region Helpers
string Lang(string key, string id = null, params object[] args) => string.Format(lang.GetMessage(key, this, id), args);
#endregion
}
}