L L4D2node

UTIL_PlayerByUserId

0x00b2af80 · 112 bytes · __cdecl

_Z19UTIL_PlayerByUserIdi

Decompiled

undefined (1 param)

/* UTIL_PlayerByUserId(int) */

int UTIL_PlayerByUserId(int param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 1;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      iVar1 = UTIL_PlayerByIndex(iVar3);
      if (((iVar1 != 0) && (*(int *)(iVar1 + 0x1f6c) != 2)) &&
         (iVar2 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar1 + 0x30)),
         iVar2 == param_1)) {
        return iVar1;
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 <= *(int *)(gpGlobals + 0x14));
  }
  return 0;
}

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)