L L4D2node

CCSGameRules::ClientSettingsChanged

0x004344d0 · 420 bytes · __thiscall

_ZN12CCSGameRules21ClientSettingsChangedEP11CBasePlayer

Decompiled

undefined (2 params)

/* CCSGameRules::ClientSettingsChanged(CBasePlayer*) */

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

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  long lVar5;
  
  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') || (CBasePlayer::SetPlayerName(param_1,pcVar3), *pcVar4 != '\0')) &&
     (iVar2 = V_strncmp(pcVar4,pcVar3,0x1f), iVar2 != 0)) {
    cVar1 = (**(code **)(*(int *)param_1 + 0x894))(param_1);
    if (cVar1 == '\0') {
      (**(code **)(*engine + 0x9c))(engine,*(undefined4 *)(param_1 + 0x30),"name \"%s\"",pcVar4);
      ClientPrint(param_1,3,"#Name_change_limit_exceeded",(char *)0x0,(char *)0x0,(char *)0x0,
                  (char *)0x0);
    }
    else {
      (**(code **)(*(int *)param_1 + 0x898))(param_1,pcVar3);
    }
  }
  param_1[0x2394] = (CBasePlayer)0x1;
  cVar1 = (**(code **)(*(int *)param_1 + 0x170))(param_1);
  if (cVar1 != '\0') {
    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,"cl_autohelp");
    if ((pcVar3 != (char *)0x0) && (lVar5 = strtol(pcVar3,(char **)0x0,10), lVar5 < 1)) {
      param_1[0x2394] = (CBasePlayer)0x0;
      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)