Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GiveNamedItem(String item) #428

Closed
Mr-Robot-ops opened this issue Apr 27, 2024 · 4 comments
Closed

GiveNamedItem(String item) #428

Mr-Robot-ops opened this issue Apr 27, 2024 · 4 comments
Labels
untriaged New issue has not been triaged

Comments

@Mr-Robot-ops
Copy link

I've been writing my first plugin over the last few weeks, working with CSharp. And yes, I'm aware that it's certainly not perfect. But after a lot of back and forth and testing, it finally did what I wanted it to do.

And now, after yesterday's update of VALVE, my plugin no longer works, so I switched to version V215. Unfortunately without any change. I already tried to debug the whole thing and the weapon values are transferred correctly.

I know you guys are very busy at the moment and have more important things to do. Maybe someone can take a look at my makeshift code?

18:36:19 [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 DecoyPlugin.DecoyPlugin.GiveMissingWeapons(CCSPlayerController player, HashSet`1 expectedWeapons) in C:\Users\Censored\Documents\CSSHARP\test3\Decoy\Decoy.cs:line 93
   at DecoyPlugin.DecoyPlugin.<Load>b__6_2() in C:\Users\Censored\Documents\CSSHARP\test3\Decoy\Decoy.cs:line 53
   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.<CreateWrappedCallback>b__18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 100

Gist-Decoy.cs GitHub

@github-actions github-actions bot added the untriaged New issue has not been triaged label Apr 27, 2024
@roflmuffin
Copy link
Owner

I've just merged in a change to make givenameditem more resilient after updates, please try again with v216

@crashzk
Copy link

crashzk commented Apr 27, 2024

Linux subscription, does it need to be updated @roflmuffin?

ianlucas/cs2-inventory-simulator-plugin#7

I tested it here and everything worked fine.

  "GiveNamedItem": {
    "signatures": {
      "library": "server",
      "windows": "\\x48\\x89\\x5C\\x24\\x2A\\x48\\x89\\x74\\x24\\x2A\\x55\\x57\\x41\\x2A\\x41\\x2A\\x41\\x2A\\x48\\x2A\\x2A\\x2A\\x2A\\x48\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x4D\\x2A\\x2A\\x48",
      "linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x49\\x89\\xD6\\x41\\x55\\x49\\x89\\xFD\\x41\\x54\\x48"
    }
  },

@roflmuffin
Copy link
Owner

@crashzk Updated the linux sig in v218

@Mr-Robot-ops
Copy link
Author

Thank you from the bottom of my heart for your quick response. Everything is working again

Mr-Robot-ops referenced this issue in kus/cs2-modded-server Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

3 participants