NockyCZ / CS2-Deathmatch

Custom Deathmatch CS2 plugin (Includes custom spawnpoints, multicfg, gun selection, spawn protection, etc).
https://buymeacoffee.com/sourcefactory
73 stars 12 forks source link

CS2 Updated today - error - cannot use weapons #34

Closed y3request closed 7 months ago

y3request commented 7 months ago

23:53:46 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> CounterStrikeSharp.API.Core.NativeException: Invalid function pointer at CounterStrikeSharp.API.Core.ScriptContext.CheckErrors() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/ScriptContext.cs:line 176 at CounterStrikeSharp.API.Core.NativeAPI.ExecuteVirtualFunction[T](IntPtr function, Object[] arguments) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/API.cs:line 1061 at CounterStrikeSharp.API.Core.CCSPlayerController.GiveNamedItem(String item) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Model/CCSPlayerController.cs:line 21 at Deathmatch.DeathmatchCore.<>cDisplayClass75_0.b__0() in C:\Users\Mates-PC\Desktop\WASD\Deathmatch\Functions\Players.cs:line 331 at InvokeStub_Action.Invoke(Object, Object, IntPtr) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.b18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 120

in-game server runs fine, respawns correctly. you can only buy one time, then the guns dont spawn and you can only knife.

NockyCZ commented 7 months ago

Giveweapons function is broken, we need to wait for the CSS update

y3request commented 7 months ago

Updated cssharp and weapons are fixed, server works fine, appears everything is ok.

I only see this error spamming console now.

07:41:58 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Int32 ByRef CounterStrikeSharp.API.Core.CCSPlayerPawnBase.get_ArmorValue()'. at Deathmatch.DeathmatchCore.OnPlayerHurt(EventPlayerHurt event, GameEventInfo info) at InvokeStub_GameEventHandler1.Invoke(Object, Span1) at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.b__18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 100

NockyCZ commented 7 months ago

Okay i will look at it

NockyCZ commented 7 months ago

Fixed - https://github.com/NockyCZ/CS2-Deathmatch/releases/tag/v1.1.2

y3request commented 7 months ago

I updated, but the plugin is not running. Its in default valve DM. not sure why.

NockyCZ commented 7 months ago

Then check the errors

y3request commented 7 months ago

2024-04-27 16:31:37.958 +00:00 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> CounterStrikeSharp.API.Core.NativeException: Invalid function pointer at CounterStrikeSharp.API.Core.ScriptContext.CheckErrors() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/ScriptContext.cs:line 176 at CounterStrikeSharp.API.Core.NativeAPI.ExecuteVirtualFunction[T](IntPtr function, Object[] arguments) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/API.cs:line 1059 at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.BaseMemoryFunction.InvokeInternal[T](Object[] args) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/DynamicFunctions/BaseMemoryFunction.cs:line 72 at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.MemoryFunctionWithReturn`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/DynamicFunctions/MemoryFunctionWithReturn.cs:line 154 at CounterStrikeSharp.API.Core.CCSPlayerController.GiveNamedItem(String item) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Model/CCSPlayerController.cs:line 26 at Deathmatch.DeathmatchCore.<>cDisplayClass75_0.b__0() in C:\Users\Mates-PC\Desktop\WASD\Deathmatch\Functions\Players.cs:line 331 at InvokeStub_Action.Invoke(Object, Object, IntPtr*) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.b18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 100

NockyCZ commented 7 months ago

CSS Version? And did you update gamedata?

y3request commented 7 months ago

Sorry wrong error,

2024-04-27 22:58:07.581 +00:00 [EROR] (cssharp:PluginManager) Failed to load plugin from /home/container/game/csgo/addons/counterstrikesharp/plugins/Deathmatch/Deathmatch.dll System.Exception: Plugin "Deathmatch.dll" requires a newer version of CounterStrikeSharp. The plugin expects version [216] but the current version is [215]. at CounterStrikeSharp.API.Core.Plugin.PluginContext.Load(Boolean hotReload) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/PluginContext.cs:line 196 at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.LoadPlugin(String path) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 125 at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.Load() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 93

my css version is Current API Version: v215 (1.0.215+7cae4be)

NockyCZ commented 7 months ago

Use 216

y3request commented 7 months ago

Use 216

my bad, it updates so often LOL i missed it.

NockyCZ commented 7 months ago

np