L L4D2node

CC_Ent_SetName

0x00600ac0 · 488 bytes · __cdecl

_Z14CC_Ent_SetNameRK8CCommand

Decompiled

undefined (1 param)

/* CC_Ent_SetName(CCommand const&) */

void CC_Ent_SetName(CCommand *param_1)

{
  char cVar1;
  int iVar2;
  CBasePlayer *pCVar3;
  char *pcVar4;
  char *pcVar5;
  CBaseEntity *pCVar6;
  undefined1 *puVar7;
  undefined4 local_20 [4];
  
  if (*(int *)param_1 < 1) {
    pCVar3 = (CBasePlayer *)UTIL_GetCommandClient();
    if (pCVar3 == (CBasePlayer *)0x0) {
      return;
    }
    cVar1 = (**(code **)(*(int *)pCVar3 + 0x16c))(pCVar3);
    if (cVar1 == '\0') {
      return;
    }
    ClientPrint(pCVar3,2,"Usage:\n   ent_setname <new name> <entity name>\n",(char *)0x0,(char *)0x0
                ,(char *)0x0,(char *)0x0);
    return;
  }
  if ((2 < *(int *)param_1) && (*(char **)(param_1 + 0x410) != "")) {
    pCVar6 = (CBaseEntity *)0x0;
    iVar2 = _V_stricmp(*(char **)(param_1 + 0x410),"");
    if (iVar2 != 0) {
      do {
        pCVar6 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar6);
        if (pCVar6 == (CBaseEntity *)0x0) {
          return;
        }
        pcVar5 = *(char **)(pCVar6 + 0x154);
        if (pcVar5 != (char *)0x0) {
          iVar2 = *(int *)param_1;
          pcVar4 = "";
          if (1 < iVar2) {
            pcVar4 = *(char **)(param_1 + 0x40c);
          }
          if (pcVar5 == pcVar4) goto LAB_00600bc4;
          iVar2 = _V_stricmp(pcVar4,pcVar5);
          if (iVar2 == 0) break;
        }
        pcVar5 = *(char **)(pCVar6 + 0x7c);
        if (pcVar5 == (char *)0x0) {
LAB_00600c50:
          pcVar5 = "";
        }
        else {
          iVar2 = *(int *)param_1;
          pcVar4 = "";
          if (1 < iVar2) {
            pcVar4 = *(char **)(param_1 + 0x40c);
          }
          if (pcVar5 == pcVar4) goto LAB_00600bc7;
          iVar2 = _V_stricmp(pcVar4,pcVar5);
          if (iVar2 == 0) break;
          pcVar5 = *(char **)(pCVar6 + 0x7c);
          if (pcVar5 == (char *)0x0) goto LAB_00600c50;
        }
        iVar2 = *(int *)param_1;
        pcVar4 = "";
        if (1 < iVar2) {
          pcVar4 = *(char **)(param_1 + 0x40c);
        }
        if (pcVar5 == pcVar4) goto LAB_00600bc4;
        iVar2 = _V_stricmp(pcVar4,pcVar5);
      } while (iVar2 != 0);
      goto LAB_00600bc2;
    }
  }
  pCVar3 = (CBasePlayer *)UTIL_GetCommandClient();
  pCVar6 = (CBaseEntity *)FindPickerEntity(pCVar3);
  if (pCVar6 == (CBaseEntity *)0x0) {
    return;
  }
LAB_00600bc2:
  iVar2 = *(int *)param_1;
LAB_00600bc4:
  pcVar5 = *(char **)(pCVar6 + 0x7c);
LAB_00600bc7:
  puVar7 = &DAT_00d539c2;
  if (1 < iVar2) {
    puVar7 = *(undefined1 **)(param_1 + 0x40c);
  }
  pcVar4 = "";
  if (pcVar5 != (char *)0x0) {
    pcVar4 = pcVar5;
  }
  Msg("Set the name of %s to %s\n",pcVar4,puVar7);
  AllocPooledString((char *)local_20);
  *(undefined4 *)(pCVar6 + 0x154) = local_20[0];
  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)