L L4D2node

CCSPlayer::ListPlayers

0x00659460 · 443 bytes · __thiscall

_ZN9CCSPlayer11ListPlayersEv

Decompiled

undefined (1 param)

/* CCSPlayer::ListPlayers() */

void __thiscall CCSPlayer::ListPlayers(CCSPlayer *this)

{
  char cVar1;
  int iVar2;
  CBaseEntity *this_00;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  int in_GS_OFFSET;
  char local_60 [64];
  int local_20;
  
  iVar5 = 1;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      iVar2 = UTIL_PlayerByIndex(iVar5);
      if (((iVar2 != 0) &&
          (this_00 = (CBaseEntity *)__dynamic_cast(iVar2,&CBasePlayer::typeinfo,&typeinfo,0),
          this_00 != (CBaseEntity *)0x0)) && (iVar2 = CBaseEntity::IsDormant(this_00), iVar2 == 0))
      {
        cVar1 = (**(code **)(*(int *)this_00 + 0x778))(this_00);
        if (cVar1 == '\0') {
          uVar3 = (**(code **)(*(int *)this_00 + 0xb8))(this_00);
          uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
          V_snprintf(local_60,0x40,"  %d : %s",uVar4,uVar3);
        }
        else {
          uVar3 = (**(code **)(*(int *)this_00 + 0xb8))(this_00);
          uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
          V_snprintf(local_60,0x40,"B %d : %s",uVar4,uVar3);
        }
        ClientPrint((CBasePlayer *)this,2,local_60,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 <= *(int *)(gpGlobals + 0x14));
  }
  ClientPrint((CBasePlayer *)this,2,"\n",(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)