(12:07:43) | Error while compiling MegaAnnouncer.cs(20,15): error CS1527: Namespace elements cannot be explicitly declared as private, protected or protected internal
getting error for something seemingly private. I've tried using public class without succes. Can anyone elaborate on this error?
So far I get that If no accessibility is specified, internal is the defaultCode:using Oxide.Core.Libraries.Covalence; using System.Collections.Generic; using Newtonsoft.Json; using Oxide.Core; using System;namespace Oxide.Plugins { [Info("MegaAnnouncer", "Maloxan", "1.0.0", ResourceId = 0)] [Description("No description")]class MegaAnnouncer : RustPlugin { void OnPlayerRespawned(BasePlayer player) { rust.BroadcastChat(player.displayName + " just respawned from a short temporary death!"); } class RepairAnnouncer : RustPlugin void OnStructureRepair(BaseCombatEntity entity, BasePlayer player) { rust.BroadcastChat(player.displayName + " has repaired a thing or two."); } } }
Yet these two announcements works if seperated into two different files, so it must be a structure issue
Solved Error CS1527 in my plugin (invalid class nesting)
Discussion in 'Rust Development' started by Maloxan, Feb 10, 2017.
-
Code:
using Oxide.Core.Libraries.Covalence; using System.Collections.Generic; using Newtonsoft.Json; using Oxide.Core; using System;namespace Oxide.Plugins { [Info("MegaAnnouncer", "Maloxan", "1.0.0", ResourceId = 0)] [Description("No description")] class MegaAnnouncer : RustPlugin { void OnPlayerRespawned(BasePlayer player) { rust.BroadcastChat(player.displayName + " just respawned from a short temporary death!"); } void OnStructureRepair(BaseCombatEntity entity, BasePlayer player) { rust.BroadcastChat(player.displayName + " has repaired a thing or two."); } } }
-