L L4D2node

CTempEntTester::Create

0x00699730 · 350 bytes · __cdecl

_ZN14CTempEntTester6CreateERK6VectorRK6QAnglePKcS7_

Decompiled

undefined (4 params)

/* CTempEntTester::Create(Vector const&, QAngle const&, char const*, char const*) */

int * CTempEntTester::Create(Vector *param_1,QAngle *param_2,char *param_3,char *param_4)

{
  float fVar1;
  long lVar2;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  int in_GS_OFFSET;
  float fVar6;
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((param_3 != (char *)0x0) && (*param_3 != '\0')) {
    lVar2 = strtol(param_3,(char **)0x0,10);
    fVar1 = *(float *)(gpGlobals + 0xc);
    if ((param_4 != (char *)0x0) && (*param_4 != '\0')) {
      V_strncpy(local_a0,param_4,0x80);
      pcVar5 = local_a0;
      do {
        if (*pcVar5 == '\0') break;
        iVar3 = tolower((int)*pcVar5);
        *pcVar5 = (char)iVar3;
        pcVar5 = pcVar5 + 1;
      } while (pcVar5 != (char *)0x0);
      piVar4 = (int *)CBaseEntity::CreateNoSpawn("te_tester",param_1,param_2,(CBaseEntity *)0x0);
      if (piVar4 == (int *)0x0) {
        piVar4 = (int *)0x0;
      }
      else {
        V_strncpy((char *)(piVar4 + 0x112),local_a0,0x40);
        fVar6 = (float)lVar2;
        if (fVar6 <= 1.0) {
          fVar6 = 1.0;
        }
        if (1000.0 <= fVar6) {
          fVar6 = 1000.0;
        }
        piVar4[0x111] = (int)(fVar6 + fVar1);
        (**(code **)(*piVar4 + 100))(piVar4);
      }
      goto LAB_0069985a;
    }
  }
  Msg("Usage:  te <lifetime> <entname>\n");
  piVar4 = (int *)0x0;
LAB_0069985a:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return piVar4;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)