L L4D2node

UTIL_PlayerByIndex

0x00b29a50 · 105 bytes · __cdecl

_Z18UTIL_PlayerByIndexi

Decompiled

undefined (1 param)

/* UTIL_PlayerByIndex(int) */

int * UTIL_PlayerByIndex(int param_1)

{
  char cVar1;
  byte *pbVar2;
  int *piVar3;
  
  if (0 < param_1) {
    if ((((*(int *)(gpGlobals + 0x14) < param_1) || (0x7ff < (uint)param_1)) ||
        (*(int *)(gpGlobals + 0x58) == 0)) ||
       (pbVar2 = (byte *)(param_1 * 0x10 + *(int *)(gpGlobals + 0x58)), (*pbVar2 & 2) != 0)) {
      return (int *)0x0;
    }
    piVar3 = *(int **)(pbVar2 + 0xc);
    if (((piVar3 != (int *)0x0) &&
        (piVar3 = (int *)(**(code **)(*piVar3 + 0x18))(piVar3), piVar3 != (int *)0x0)) &&
       (cVar1 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar1 != '\0')) {
      return piVar3;
    }
  }
  return (int *)0x0;
}

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)