L L4D2node

ForEachTerrorPlayer<CDumpTeamDesired>

0x009ea730 · 307 bytes · __cdecl

_Z19ForEachTerrorPlayerI16CDumpTeamDesiredEbRT_

Decompiled

bool (1 param)

/* bool ForEachTerrorPlayer<CDumpTeamDesired>(CDumpTeamDesired&) */

bool ForEachTerrorPlayer<CDumpTeamDesired>(CDumpTeamDesired *param_1)

{
  char cVar1;
  int *piVar2;
  KeyValues *this;
  char *pcVar3;
  char *pcVar4;
  undefined4 uVar5;
  int iVar6;
  int iVar7;
  
  iVar7 = 1;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      piVar2 = (int *)UTIL_PlayerByIndex(iVar7);
      if ((((piVar2 != (int *)0x0) && (piVar2[0xc] != 0)) &&
          (piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
         ((cVar1 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar1 != '\0' && (piVar2[0x7db] != 2))))
      {
        this = (KeyValues *)CDirector::PlayerAvatarGet(TheDirector,(edict_t *)piVar2[0xc]);
        if (this == (KeyValues *)0x0) {
          pcVar3 = "<null>";
          pcVar4 = "<null>";
        }
        else {
          pcVar3 = (char *)KeyValues::GetString(this,"avatar","");
          pcVar4 = (char *)KeyValues::GetString(this,"team","");
        }
        uVar5 = (**(code **)(*piVar2 + 0xb8))(piVar2);
        if (piVar2[0xc] == 0) {
          iVar6 = 0;
        }
        else {
          iVar6 = piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
        }
        Msg("%d: %s: team = \'%s\', avatar = \'%s\'\n",iVar6,uVar5,pcVar4,pcVar3);
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 <= *(int *)(gpGlobals + 0x14));
  }
  return true;
}

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)