L L4D2node

nb_delete_all

0x00752660 · 236 bytes · __cdecl

_ZL13nb_delete_allRK8CCommand

Decompiled

undefined (1 param)

/* nb_delete_all(CCommand const&) */

void nb_delete_all(CCommand *param_1)

{
  char *pcVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  char *pcVar6;
  int iVar7;
  undefined4 local_20 [4];
  
  cVar3 = UTIL_IsCommandIssuedByServerAdmin();
  if (cVar3 != '\0') {
    local_20[0] = 0xffffffff;
    if (*(int *)param_1 == 2) {
      pcVar1 = *(char **)(param_1 + 0x40c);
      if (0 < DAT_00ff98e4) {
        iVar4 = 0;
        do {
          piVar2 = *(int **)(g_Teams + iVar4 * 4);
          pcVar6 = (char *)(**(code **)(*piVar2 + 0x32c))(piVar2);
          if ((pcVar6 == pcVar1) || (iVar7 = _V_stricmp(pcVar1,pcVar6), iVar7 == 0)) {
            piVar2 = *(int **)(g_Teams + iVar4 * 4);
            if (piVar2 != (int *)0x0) {
              local_20[0] = (**(code **)(*piVar2 + 0x328))(piVar2);
              goto LAB_0075267f;
            }
            break;
          }
          iVar4 = iVar4 + 1;
        } while (iVar4 < DAT_00ff98e4);
      }
      Msg("Invalid team \'%s\'\n",pcVar1);
    }
    else {
LAB_0075267f:
      iVar4 = TheNextBots();
      uVar5 = (uint)*(ushort *)(iVar4 + 0x10);
      if (uVar5 != 0xffff) {
        iVar7 = *(int *)(iVar4 + 4);
        do {
          cVar3 = NextBotDestroyer::operator()
                            ((NextBotDestroyer *)local_20,*(INextBot **)(iVar7 + uVar5 * 8));
          if (cVar3 == '\0') {
            return;
          }
          iVar7 = *(int *)(iVar4 + 4);
          uVar5 = (uint)*(ushort *)(iVar7 + 6 + uVar5 * 8);
        } while (uVar5 != 0xffff);
      }
    }
  }
  return;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)