CCSGameRules::ClientCommand
0x00434d60 · 576 bytes · __thiscall
_ZN12CCSGameRules13ClientCommandEP11CBaseEntityRK8CCommand
Decompiled
undefined (3 params)
/* CCSGameRules::ClientCommand(CBaseEntity*, CCommand const&) */
undefined4 __thiscall
CCSGameRules::ClientCommand(CCSGameRules *this,CBaseEntity *param_1,CCommand *param_2)
{
char cVar1;
int iVar2;
undefined4 uVar3;
char *pcVar4;
CBasePlayer *pCVar5;
int in_GS_OFFSET;
char local_40 [32];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((param_1 == (CBaseEntity *)0x0) ||
(cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 == '\0')) {
pCVar5 = (CBasePlayer *)0x0;
if (0 < *(int *)param_2) goto LAB_00434da3;
LAB_00434e3c:
pcVar4 = "";
LAB_00434db0:
iVar2 = _V_stricmp(pcVar4,"changeteam");
if (iVar2 != 0) {
if (*(int *)param_2 < 1) {
pcVar4 = "";
LAB_00434ddb:
iVar2 = _V_stricmp(pcVar4,"nextmap");
if (iVar2 != 0) {
cVar1 = (**(code **)(*(int *)pCVar5 + 0x634))(pCVar5,param_2);
if (cVar1 == '\0') {
uVar3 = CTeamplayRules::ClientCommand((CTeamplayRules *)this,param_1,param_2);
goto LAB_00434e15;
}
goto LAB_00434e10;
}
}
else {
pcVar4 = *(char **)(param_2 + 0x408);
if (pcVar4 != "nextmap") goto LAB_00434ddb;
}
if ((float)*(int *)(pCVar5 + 0x2410) < *(float *)(gpGlobals + 0xc)) {
if ((nextlevel._20_4_ & 0x1000) == 0) {
pcVar4 = "";
if (*(char **)(nextlevel._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(nextlevel._28_4_ + 0x24);
}
if (*pcVar4 != '\0') goto LAB_00434e7b;
LAB_00434ef7:
(**(code **)(*(int *)this + 0x240))(this,local_40,0x20,0);
}
else {
LAB_00434e7b:
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((nextlevel._20_4_ & 0x1000) == 0) {
pcVar4 = "";
if (*(char **)(nextlevel._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(nextlevel._28_4_ + 0x24);
}
}
iVar2 = (**(code **)(*engine + 4))(engine,pcVar4);
if (iVar2 == 0) goto LAB_00434ef7;
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((nextlevel._20_4_ & 0x1000) == 0) {
pcVar4 = "";
if (*(char **)(nextlevel._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(nextlevel._28_4_ + 0x24);
}
}
V_strncpy(local_40,pcVar4,0x20);
}
ClientPrint(pCVar5,3,"#game_nextmap",local_40,(char *)0x0,(char *)0x0,(char *)0x0);
*(int *)(pCVar5 + 0x2410) = (int)(*(float *)(gpGlobals + 0xc) + 1.0);
uVar3 = 1;
goto LAB_00434e15;
}
}
}
else {
pCVar5 = (CBasePlayer *)param_1;
if (*(int *)param_2 < 1) goto LAB_00434e3c;
LAB_00434da3:
pcVar4 = *(char **)(param_2 + 0x408);
if (pcVar4 != "changeteam") goto LAB_00434db0;
}
LAB_00434e10:
uVar3 = 1;
LAB_00434e15:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar3;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.