L L4D2node

CTeamplayRules::ClientSettingsChanged

0x004d0f90 · 301 bytes · __thiscall

_ZN14CTeamplayRules21ClientSettingsChangedEP11CBasePlayer

Decompiled

undefined (2 params)

/* CTeamplayRules::ClientSettingsChanged(CBasePlayer*) */

void __thiscall CTeamplayRules::ClientSettingsChanged(CTeamplayRules *this,CBasePlayer *param_1)

{
  code *pcVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  int *piVar5;
  undefined4 uVar6;
  
  if (*(int *)(param_1 + 0x30) == 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  pcVar3 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar2,"name");
  pcVar4 = (char *)(**(code **)(*(int *)param_1 + 0xb8))(param_1);
  if (*pcVar4 != '\0') {
    iVar2 = _V_strcmp(pcVar4,pcVar3);
    if (iVar2 != 0) {
      piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                (gameeventmanager,"player_changename",0,0);
      if (piVar5 != (int *)0x0) {
        pcVar1 = *(code **)(*piVar5 + 0x30);
        uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
        (*pcVar1)(piVar5,"userid",uVar6);
        (**(code **)(*piVar5 + 0x3c))(piVar5,"oldname",pcVar4);
        (**(code **)(*piVar5 + 0x3c))(piVar5,"newname",pcVar3);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
      }
      CBasePlayer::SetPlayerName(param_1,pcVar3);
      return;
    }
  }
  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)