Skip to content

Conversation

@oylsister
Copy link
Contributor

  • Signature Updates
  • Updated to latest CS2 SDK

@stefanx111 mentioned that GetCSWeaponDataFromKey got new 5 parameters for this function in discord.
https://discord.com/channels/1160907911501991946/1160907912445710479/1417655472512827392

@oylsister
Copy link
Contributor Author

I made my own branch for build testing with latest sdk here. https://github.com/oylsister/CounterStrikeSharp/actions/runs/17786668246

@oylsister oylsister marked this pull request as draft September 17, 2025 04:51
roflmuffin
roflmuffin previously approved these changes Sep 17, 2025
@roflmuffin
Copy link
Owner

I'm currently down with illness so can't verify much of this, is it good to go?

@oylsister oylsister marked this pull request as ready for review September 17, 2025 06:41
@oylsister
Copy link
Contributor Author

yeah, I think this good to go.

@oylsister
Copy link
Contributor Author

Need to find offset for CEntityResourceManifest_AddResource

@oylsister oylsister marked this pull request as draft September 17, 2025 07:46
@milesizzo
Copy link

milesizzo commented Sep 17, 2025

I think the signature for UTIL_CreateEntityByName has also changed, I get a segfault when trying to access it (Linux). Works now

@stefanx111
Copy link
Contributor

  • Signature Updates
  • Updated to latest CS2 SDK

@stefanx111 mentioned that GetCSWeaponDataFromKey got new 5 parameters for this function in discord. https://discord.com/channels/1160907911501991946/1160907912445710479/1417655472512827392

The signature you gave GetCSWeaponDataFromKey has 2 parameters, while the function I found with five parameters is a function that returns your function.
So basically, both work but your function is more reliable

@isMADAO
Copy link
Contributor

isMADAO commented Sep 17, 2025

"CCSPlayer_ItemServices_DropActivePlayerWeapon": {
    "offsets": {
      "windows": 21,
      "linux": 22
    }
  }

It works fine on Windows.
I haven’t tested it on Linux.

Copy link
Contributor Author

@oylsister oylsister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find offset for AddResource so I think implement the method like cs2f, might just better than finding signature every time when something break.

@oylsister
Copy link
Contributor Author

oylsister commented Sep 17, 2025

"CCSPlayer_ItemServices_DropActivePlayerWeapon": {
    "offsets": {
      "windows": 21,
      "linux": 22
    }
  }

It works fine on Windows. I haven’t tested it on Linux.

Add 1 usually work

@switz
Copy link
Contributor

switz commented Sep 17, 2025

Getting crashes on this version, so it's not quite ready.

No error messages though, just crashing on player join team

CCSPlayerController_ChangeTeam and UTIL_ClientPrintAll are crashing on linux

@aambert
Copy link

aambert commented Sep 17, 2025

hi
thank you very much for your work did you manage to make it work after the last commit

@milesizzo
Copy link

FYI still get a segfault using CBaseEntity_DispatchSpawn (Linux).

@xLeviNx
Copy link
Contributor

xLeviNx commented Sep 18, 2025

FYI still get a segfault using CBaseEntity_DispatchSpawn (Linux).

Are we sure this is the culprit?

@milesizzo
Copy link

milesizzo commented Sep 18, 2025

Are we sure this is the culprit?

Not 100% but I get a segfault when executing entity.DispatchSpawn.

Using this command:

    [ConsoleCommand("spawn_entity", "Spawn an entity")]
    [CommandHelper(minArgs: 1, usage: "[entity_name]", whoCanExecute: CommandUsage.SERVER_ONLY)]
    public void OnSpawnEntity(CCSPlayerController? player, CommandInfo command)
    {
        if (command.ArgCount < 2)
        {
            command.ReplyToCommand("Please provide an entity name");
            return;
        }
        var entityName = command.GetArg(1);
        var entity = Utilities.CreateEntityByName<CBaseEntity>(entityName);
        if (entity is null)
        {
            command.ReplyToCommand($"Failed to create entity '{entityName}'");
            return;
        }
        command.ReplyToCommand("Setting entity position...");
        entity.Teleport(Vector.Zero, QAngle.Zero, Vector.Zero);
        command.ReplyToCommand("Dispatching entity spawn...");
        entity.DispatchSpawn();
        command.ReplyToCommand($"Entity '{entityName}' spawned");
    }
Sep 18 00:38:10:  00:38:10 [INFO] (cssharp:PluginContext) Loading plugin CanaryPlugin
Sep 18 00:38:10:  00:38:10 [INFO] (cssharp:PluginContext) Finished loading plugin CanaryPlugin
Sep 18 00:38:10:  2778.015625 Long frame (WarmupPeriod): 28.50ms elapsed, 0.43ms sim time, 1 ticks, 177793..177793.
Sep 18 00:38:21:  spawn_entity weapon_ak47
Sep 18 00:38:21:  Setting entity position...
Sep 18 00:38:21:  Dispatching entity spawn...
Sep 18 00:38:21:  --- SERVER EXITED ---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants