L L4D2node

UTIL_KickBotFromTeam

0x0042dd60 · 276 bytes · __cdecl

_Z20UTIL_KickBotFromTeami

Decompiled

undefined (1 param)

/* UTIL_KickBotFromTeam(int) */

undefined4 UTIL_KickBotFromTeam(int param_1)

{
  code *pcVar1;
  char cVar2;
  CBaseEntity *this;
  undefined4 uVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  
  iVar6 = 1;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      this = (CBaseEntity *)UTIL_PlayerByIndex(iVar6);
      if ((((this != (CBaseEntity *)0x0) &&
           (uVar3 = (**(code **)(*(int *)this + 0x778))(this), (char)uVar3 != '\0')) &&
          (cVar2 = (**(code **)(*(int *)this + 300))(this), cVar2 == '\0')) &&
         (iVar4 = CBaseEntity::GetTeamNumber(this), iVar4 == param_1)) goto LAB_0042ddce;
      iVar6 = iVar6 + 1;
    } while (iVar6 <= *(int *)(gpGlobals + 0x14));
    if (0 < *(int *)(gpGlobals + 0x14)) {
      iVar6 = 1;
      do {
        while ((this = (CBaseEntity *)UTIL_PlayerByIndex(iVar6), this == (CBaseEntity *)0x0 ||
               (uVar3 = (**(code **)(*(int *)this + 0x778))(this), (char)uVar3 == '\0'))) {
          iVar6 = iVar6 + 1;
          if (*(int *)(gpGlobals + 0x14) < iVar6) {
            return 0;
          }
        }
        iVar4 = CBaseEntity::GetTeamNumber(this);
        if (param_1 == iVar4) {
LAB_0042ddce:
          pcVar1 = *(code **)(*engine + 0x94);
          uVar5 = (**(code **)(*(int *)this + 0xb8))(this);
          uVar5 = UTIL_VarArgs("kick \"%s\"\n",uVar5);
          (*pcVar1)(engine,uVar5);
          return uVar3;
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 <= *(int *)(gpGlobals + 0x14));
    }
  }
  return 0;
}

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)