Does anyone know how to fix this?Code:using System; using System.Collections.Generic; using Oxide.Core; using Oxide.Core.Configuration; using Oxide.Game.Rust.Cui; using Oxide.Core.Plugins; using UnityEngine; using System.Linq; using System.Reflection; namespace Oxide.Plugins { [Info("AllItems", "Kappasaurus", "0.1.0")] [Description("Unlocks items and block the ability to earn XP/Levels")] class AllItems : RustPlugin { #region Config File protected override void LoadDefaultConfig() { PrintWarning("Creating a new configuration file"); Config["BlockXPEarn"] = true; Config["UnlockAll"] = true; SaveConfig(); } #endregion #region Unlocking the blueprints if (Config["UnlockAll"] == true) { void OnPlayerInit(BasePlayer player); { foreach (var item in ItemManager.itemList) player.blueprints.Unlock(item); } #endregion #region Block XP/Levels OnEarnXp(BasePlayer player, float amount) => 0f; #endregion } }
(02:52:43) | [Oxide] 23:52 [Error] AllItems.cs(37,250): error CS1525: Unexpected symbol `end-of-file'
[DOUBLEPOST=1468134198][/DOUBLEPOST]I probably just have a hook in a hook, but I still need help![]()
Errors with some of my code
Discussion in 'Rust Development' started by Kappasaurus, Jul 10, 2016.
-
@LaserHydra any idea?
-
The brace on line 11 doesn't have a closing brace.
The if at line 26 and the brace at line 27 need to be in some method. -
you mean like bool?
-
You just put that if randomly in the class body (also the line numbers would be +1 with the newline at the start of the code), I think you want to have that if in OnPlayerInit.
-
Thanks for the reply, one last error.
OnEarnXp(BasePlayer player, float amount) => 0f;
That is exactly @Wulf's code.
It is saying => is an unexpected symbol, and it is expecting : ; or { -
You still need to add the return type of OnEarnXp.
-
Wulf Community Admin
Add object to the front of OnEarnXp like the example I gave you before.
