L L4D2node

ClientPutInServer

0x0096e640 · 147 bytes · __cdecl

_Z17ClientPutInServerP7edict_tPKc

Decompiled

undefined (2 params)

/* ClientPutInServer(edict_t*, char const*) */

void ClientPutInServer(edict_t *param_1,char *param_2)

{
  int *piVar1;
  char cVar2;
  edict_t *peVar3;
  CBasePlayer *pCVar4;
  
  peVar3 = param_1;
  if ((((param_1 != (edict_t *)0x0) ||
       ((peVar3 = *(edict_t **)(gpGlobals + 0x58), peVar3 != (edict_t *)0x0 &&
        (((byte)*peVar3 & 2) == 0)))) && (piVar1 = *(int **)(peVar3 + 0xc), piVar1 != (int *)0x0))
     && ((pCVar4 = (CBasePlayer *)(**(code **)(*piVar1 + 0x18))(piVar1),
         pCVar4 != (CBasePlayer *)0x0 &&
         (cVar2 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4), cVar2 != '\0')))) {
    Warning("Second ClientPutInServer for %s\n",param_2);
    CBasePlayer::SetPlayerName(pCVar4,param_2);
    return;
  }
  pCVar4 = (CBasePlayer *)CTerrorPlayer::CreatePlayer("player",param_1);
  CBasePlayer::SetPlayerName(pCVar4,param_2);
  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)