CBasePlayer::ObserverUse
0x007a89f0 · 210 bytes · __thiscall
_ZN11CBasePlayer11ObserverUseEb
Decompiled
undefined (2 params)
/* CBasePlayer::ObserverUse(bool) */
void __thiscall CBasePlayer::ObserverUse(CBasePlayer *this,bool param_1)
{
char cVar1;
int *piVar2;
int iVar3;
int iVar4;
CHLTVDirector *this_00;
piVar2 = (int *)HLTVDirector();
cVar1 = (**(code **)(*piVar2 + 0x2c))(piVar2);
if (((cVar1 != '\0') && (iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar3 == 1)) &&
(param_1)) {
iVar4 = HLTVDirector();
iVar3 = *(int *)(this + 0x30);
if (*(int *)(iVar4 + 0x1cc) == 0) {
_param_1 = 0;
if (iVar3 != 0) {
_param_1 = iVar3 - *(int *)(gpGlobals + 0x58) >> 4;
}
this_00 = (CHLTVDirector *)HLTVDirector();
}
else {
if ((iVar3 == 0) || (*(int *)(iVar4 + 0x1cc) != iVar3 - *(int *)(gpGlobals + 0x58) >> 4)) {
ClientPrint(this,3,"Camera in use by other player.",(char *)0x0,(char *)0x0,(char *)0x0,
(char *)0x0);
return;
}
this_00 = (CHLTVDirector *)HLTVDirector();
_param_1 = 0;
}
CHLTVDirector::SetCameraMan(this_00,_param_1);
return;
}
return;
}
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.