L L4D2node

setpos_exact

0x00640f40 · 321 bytes · __cdecl

_ZL12setpos_exactRK8CCommand

Decompiled

undefined (1 param)

/* setpos_exact(CCommand const&) */

void setpos_exact(CCommand *param_1)

{
  char cVar1;
  CBasePlayer *this;
  char *pcVar2;
  undefined4 uVar3;
  undefined1 local_18 [8];
  undefined4 local_10;
  
  if (*(int *)(*(int *)(sv_cheats + 0x1c) + 0x30) == 0) {
    return;
  }
  this = (CBasePlayer *)UTIL_GetCommandClient();
  if (this == (CBasePlayer *)0x0) {
    return;
  }
  cVar1 = (**(code **)(*(int *)this + 0x16c))(this);
  if (cVar1 == '\0') {
    return;
  }
  if (*(int *)param_1 < 3) {
    ClientPrint(this,2,"Usage:  setpos_exact x y <z optional>\n",(char *)0x0,(char *)0x0,(char *)0x0
                ,(char *)0x0);
    return;
  }
  if (((byte)this[0x14d] & 8) == 0) {
    uVar3 = *(undefined4 *)(this + 0x2e8);
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    pcVar2 = "";
    uVar3 = *(undefined4 *)(this + 0x2e8);
    if (*(int *)param_1 < 2) goto LAB_00640fa8;
  }
  pcVar2 = *(char **)(param_1 + 0x40c);
LAB_00640fa8:
  GetHexFloat(pcVar2);
  pcVar2 = "";
  if (2 < *(int *)param_1) {
    pcVar2 = *(char **)(param_1 + 0x410);
  }
  GetHexFloat(pcVar2);
  if (*(int *)param_1 == 4) {
    GetHexFloat(*(char **)(param_1 + 0x414));
  }
  local_10 = uVar3;
  (**(code **)(*(int *)this + 0x1dc))(this,local_18,0,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)