Error while compiling EventManager: 'PlayerInventory' does not contain a definition for 'AllItems' and no accessible extension method 'AllItems' accepting a first argument of type 'PlayerInventory' could be found (are you missing a using directive or an assembly reference?) | Line: 2214, Pos: 48
Error after force wipe when compiling
Tengo el mismo error, ¿encontraste una solución?
¿También recibe un error en EMInterface?
¿También recibe un error en EMInterface?
All plugins rely on each other, so I'm getting the error with EMInterface as well. No fix yet.
I haven't confirmed yet if it actually works in-game, but I managed to fix the compilation error by replacing this block:
internal static void StripInventory(BasePlayer player)
{
Item[] allItems = player.inventory.AllItems();
for (int i = allItems.Length - 1; i >= 0; i--)
{
Item item = allItems[i];
item.RemoveFromContainer();
item.Remove();
}
}
With this:
internal static void StripInventory(BasePlayer player)
{
var itemList = Pool.Get<List<Item>>();
player.inventory.GetAllItems(itemList);
foreach (var item in itemList)
{
item.RemoveFromContainer();
item.Remove();
}
Pool.Free(ref itemList);
}
Again, I still need to confirm ingame if it still works but normally it should
KajWithAJ
I haven't confirmed yet if it actually works in-game, but I managed to fix the compilation error by replacing this block:
Thanks! I didn't try it, but looking at the difference between the codes makes me think: shouldn't "RestoreItems" be changed in the same manner? RestoreItems looks to have the same kind of build (for loop) but is missing the Pool thing. Not sure what that is though.
================
Update: tested this with the Deathmatch event:
- Hotbar items are taken on event start
- Hotbar items are returned on event end
- Selected kit is given at event start
However:
- Selected kit is not taken on event end
Pude corregir el error
The plugin was updated 20 hours ago and should work again.
> c.reload EMInterface
Failed compiling 'EMInterface.cs':
Failed compiling 'EMInterface.cs':
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)cedural Map] 41fps 124gc 2h50m50s
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
Merged post
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!5] ManBearPig [Procedural Map] 34fps 124gc 2h55m51s
Couldn't find required plugin 'EMInterface' for 'EventManager'
Couldn't find required plugin 'EMInterface' for 'EventManager'
HotSteamingGarbage> c.reload EMInterface
Failed compiling 'EMInterface.cs':
Failed compiling 'EMInterface.cs':
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)cedural Map] 41fps 124gc 2h50m50s
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
Merged post
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!5] ManBearPig [Procedural Map] 34fps 124gc 2h55m51s
Couldn't find required plugin 'EMInterface' for 'EventManager'
Couldn't find required plugin 'EMInterface' for 'EventManager'
I am getting this exact error
Failed compiling 'EMInterface.cs':
Failed compiling 'EMInterface.cs':
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)
1. The type or namespace name 'EventManager' could not be found (are you missing a using directive or an assembly reference?) [CS0246]
(EMInterface 64 line 808)
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
2. The name 'EventManager' does not exist in the current context [CS0103]
(EMInterface 93 line 73)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
3. 'ArgEx.Player(ConsoleSystem.Arg)' is a method, which is not valid in the given context [CS0119]
(EMInterface 202 line 901)
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!
Warning! 'EventManager' uses UnityEngine.GameObject.FindObjectsOfType. That may cause significant performance drops, and/or server stalls. Report to the developer or use at your own discretion!
Couldn't find required plugin 'EMInterface' for 'EventManager'
Couldn't find required plugin 'EMInterface' for 'EventManager'