L L4D2node

CServerTools::SnapPlayerToPosition

0x00680a70 · 177 bytes · __thiscall

_ZN12CServerTools20SnapPlayerToPositionERK6VectorRK6QAngleP13IClientEntity

Decompiled

undefined (4 params)

/* CServerTools::SnapPlayerToPosition(Vector const&, QAngle const&, IClientEntity*) */

undefined4 __thiscall
CServerTools::SnapPlayerToPosition
          (CServerTools *this,Vector *param_1,QAngle *param_2,IClientEntity *param_3)

{
  CBaseEntity *this_00;
  float *pfVar1;
  float local_18;
  float local_14;
  float local_10;
  
  this_00 = (CBaseEntity *)(**(code **)(*(int *)this + 8))(this,param_3);
  if ((this_00 == (CBaseEntity *)0x0) &&
     (this_00 = (CBaseEntity *)UTIL_GetLocalPlayer(), this_00 == (CBaseEntity *)0x0)) {
    return 0;
  }
  pfVar1 = (float *)(**(code **)(*(int *)this_00 + 0x250))(this_00);
  local_18 = *(float *)param_1 - *pfVar1;
  local_14 = *(float *)(param_1 + 4) - pfVar1[1];
  local_10 = *(float *)(param_1 + 8) - pfVar1[2];
  CBaseEntity::SetAbsOrigin(this_00,(Vector *)&local_18);
  CBasePlayer::SnapEyeAngles((CBasePlayer *)this_00,param_2);
  (**(code **)(*(int *)this_00 + 0x98))(this_00,0,0xffffffff);
  return 1;
}

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)