thing is that i right now just have the default from docs and i get an error "Error while compiling: ServerAnnounce.cs(25,11): error CS0246: The type or namespace name `PluginConfig' could not be found. Are you missing an assembly reference?" in the game console
namespace Oxide.Plugins
{
[Info("ServerAnnounce", "NubbbZ", "1")]
[Description("Broadcasts a message server wide in chat when ether a player Connects/Disconnects/Dies/Kicks/")]
class ServerAnnounce : RustPlugin
{
#region Config
private PluginConfig config;
private void Init()
{
config = Config.ReadObject<PluginConfig>();
}
protected override void LoadDefaultConfig()
{
Config.WriteObject(GetDefaultConfig(), true);
}
private PluginConfig GetDefaultConfig()
{
return new PluginConfig
{
ShowJoinMessage = true,
ShowLeaveMessage = true,
JoinMessage = "Welcome to this server",
LeaveMessage = "Goodbye"
};
}
#endregion
#region Hooks
void OnPlayerInit(BasePlayer player)
{
Server.Broadcast(player.displayName + "Connected!");
}
void OnPlayerDisconnected(BasePlayer player, string reason)
{
Server.Broadcast(player.displayName + " Disconnected!");
}
object OnPlayerDie(BasePlayer player, HitInfo info)
{
Server.Broadcast(player.displayName + " Has died to " + info.InitiatorPlayer.displayName);
return null;
}
void OnPlayerKicked(BasePlayer player, string reason)
{
Server.Broadcast(player.displayName + " Disconnected!" + " (" + reason + ")");
}
object OnPlayerViolation(BasePlayer player, AntiHackType type, float amount)
{
Server.Broadcast(player.displayName + " Kicked!" + " (" + type + " : " + amount + ")");
return null;
}
#endregion
}
}