CCSPlayer::ClientCommand
0x00660240 · 826 bytes · __thiscall
_ZN9CCSPlayer13ClientCommandERK8CCommand
Decompiled
undefined (2 params)
/* CCSPlayer::ClientCommand(CCommand const&) */
uint __thiscall CCSPlayer::ClientCommand(CCSPlayer *this,CCommand *param_1)
{
CCSPlayer CVar1;
char cVar2;
int iVar3;
uint uVar4;
long lVar5;
char *pcVar6;
CCSPlayer CVar7;
iVar3 = *(int *)param_1;
if (iVar3 < 1) {
iVar3 = _V_stricmp("","jointeam");
if (iVar3 != 0) {
iVar3 = _V_stricmp("","spectate");
if (iVar3 == 0) {
LAB_00660410:
uVar4 = ShouldRunRateLimitedCommand(this,param_1);
if ((char)uVar4 == '\0') {
return 1;
}
(**(code **)(*(int *)this + 0x824))(this,1,0,0);
return uVar4;
}
pcVar6 = "";
iVar3 = _V_stricmp("","joingame");
if (iVar3 == 0) {
LAB_006604a0:
if (*(int *)(this + 0x23bc) != 1) {
return 1;
}
State_Leave(this,2);
State_Enter(this,2);
return 1;
}
LAB_006602d7:
iVar3 = _V_stricmp(pcVar6,"menuselect");
if ((iVar3 != 0) && (cVar2 = HandleRadioAliasCommands(this,pcVar6), cVar2 == '\0')) {
if ((pcVar6 == "listplayers") || (iVar3 = _V_stricmp(pcVar6,"listplayers"), iVar3 == 0)) {
ListPlayers(this);
}
else {
if ((pcVar6 == "ignorerad") || (iVar3 = _V_stricmp(pcVar6,"ignorerad"), iVar3 == 0)) {
CVar1 = this[0x23b8];
CVar7 = SUB41((byte)CVar1 ^ 1,0);
this[0x23b8] = CVar7;
if (CVar7 == (CCSPlayer)0x0) {
ClientPrint((CBasePlayer *)this,3,"#Accept_Radio",(char *)0x0,(char *)0x0,(char *)0x0,
(char *)0x0);
return 1;
}
ClientPrint((CBasePlayer *)this,3,"#Ignore_Radio",(char *)0x0,(char *)0x0,(char *)0x0,
(char *)0x0);
return (byte)CVar1 ^ 1;
}
if ((pcVar6 != "become_vip") && (iVar3 = _V_stricmp(pcVar6,"become_vip"), iVar3 != 0)) {
uVar4 = CBaseMultiplayerPlayer::ClientCommand((CBaseMultiplayerPlayer *)this,param_1);
return uVar4;
}
}
}
return 1;
}
}
else {
pcVar6 = *(char **)(param_1 + 0x408);
if (pcVar6 == "jointeam") goto LAB_0066038a;
iVar3 = _V_stricmp(pcVar6,"jointeam");
if (iVar3 != 0) {
if ((pcVar6 == "spectate") || (iVar3 = _V_stricmp(pcVar6,"spectate"), iVar3 == 0))
goto LAB_00660410;
if ((pcVar6 == "joingame") || (iVar3 = _V_stricmp(pcVar6,"joingame"), iVar3 == 0))
goto LAB_006604a0;
if (pcVar6 == "menuselect") {
return 1;
}
goto LAB_006602d7;
}
}
iVar3 = *(int *)param_1;
LAB_0066038a:
if (iVar3 < 2) {
Warning("Player sent bad jointeam syntax\n");
}
uVar4 = ShouldRunRateLimitedCommand(this,param_1);
if ((char)uVar4 == '\0') {
return 1;
}
if (*(int *)param_1 < 2) {
pcVar6 = "";
}
else {
pcVar6 = *(char **)(param_1 + 0x40c);
}
lVar5 = strtol(pcVar6,(char **)0x0,10);
(**(code **)(*(int *)this + 0x824))(this,lVar5,0,0);
return uVar4;
}
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.