L L4D2node

SendToConsole

0x00b42c80 · 121 bytes · __cdecl

_ZL13SendToConsolePKc

Decompiled

undefined (1 param)

/* SendToConsole(char const*) */

void SendToConsole(char *param_1)

{
  char cVar1;
  int iVar2;
  
  if (*(int *)(gpGlobals + 0x14) < 2) {
    iVar2 = UTIL_GetLocalPlayer();
  }
  else {
    cVar1 = (**(code **)(*engine + 8))(engine);
    if (cVar1 != '\0') goto LAB_00b42cf0;
    iVar2 = UTIL_GetListenServerHost();
  }
  if (iVar2 != 0) {
    (**(code **)(*engine + 0x9c))(engine,*(undefined4 *)(iVar2 + 0x30),"%s",param_1);
    return;
  }
LAB_00b42cf0:
  DevMsg("Cannot execute \"%s\", no player\n",param_1);
  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)