L L4D2node

z_spawn_const_pos

0x00a583f0 · 485 bytes · __cdecl

_ZL17z_spawn_const_posRK8CCommand

Decompiled

undefined (1 param)

/* z_spawn_const_pos(CCommand const&) */

void z_spawn_const_pos(CCommand *param_1)

{
  int iVar1;
  char cVar2;
  CBasePlayer *pCVar3;
  char *pcVar4;
  double dVar5;
  
  pCVar3 = (CBasePlayer *)UTIL_GetCommandClient();
  if ((pCVar3 != (CBasePlayer *)0x0) &&
     (cVar2 = (**(code **)(*(int *)pCVar3 + 0x16c))(pCVar3), cVar2 != '\0')) {
    iVar1 = *(int *)param_1;
    if (iVar1 < 2) {
      ClientPrint(pCVar3,2,"Constant z_spawn position disabled.\n",(char *)0x0,(char *)0x0,
                  (char *)0x0,(char *)0x0);
      g_bSpawnAtConstPos = 0;
    }
    else {
      g_bSpawnAtConstPos = 1;
      g_vConstSpawnPos = 0.0;
      DAT_01028648 = 0.0;
      DAT_0102864c = 0.0;
      dVar5 = strtod(*(char **)(param_1 + 0x40c),(char **)0x0);
      g_vConstSpawnPos = (float)dVar5;
      if (iVar1 != 2) {
        pcVar4 = "";
        if (2 < *(int *)param_1) {
          pcVar4 = *(char **)(param_1 + 0x410);
        }
        dVar5 = strtod(pcVar4,(char **)0x0);
        DAT_01028648 = (float)dVar5;
        if (iVar1 != 3) {
          pcVar4 = "";
          if (3 < *(int *)param_1) {
            pcVar4 = *(char **)(param_1 + 0x414);
          }
          dVar5 = strtod(pcVar4,(char **)0x0);
          DAT_0102864c = (float)dVar5;
        }
      }
      pcVar4 = (char *)UTIL_VarArgs("Constant z_spawn position set to %f, %f, %f.\n",
                                    (double)g_vConstSpawnPos,(double)DAT_01028648,
                                    (double)DAT_0102864c);
      ClientPrint(pCVar3,2,pcVar4,(char *)0x0,(char *)0x0,(char *)0x0,(char *)0x0);
    }
  }
  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)