CC_setang_f
0x006403f0 · 383 bytes · __cdecl
_Z11CC_setang_fRK8CCommand
Decompiled
undefined (1 param)
/* CC_setang_f(CCommand const&) */
void CC_setang_f(CCommand *param_1)
{
char cVar1;
CBasePlayer *this;
char *pcVar2;
float fVar3;
double dVar4;
float local_18;
float local_14;
float local_10;
if (*(int *)(*(int *)(sv_cheats + 0x1c) + 0x30) == 0) {
return;
}
this = (CBasePlayer *)UTIL_GetCommandClient();
if (this == (CBasePlayer *)0x0) {
return;
}
cVar1 = (**(code **)(*(int *)this + 0x16c))(this);
if (cVar1 == '\0') {
return;
}
if (*(int *)param_1 < 3) {
ClientPrint(this,2,"Usage: setang pitch yaw <roll optional>\n",(char *)0x0,(char *)0x0,
(char *)0x0,(char *)0x0);
return;
}
if (((byte)this[0x14d] & 8) == 0) {
fVar3 = *(float *)(this + 900);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
pcVar2 = "";
fVar3 = *(float *)(this + 900);
if (*(int *)param_1 < 2) goto LAB_00640458;
}
pcVar2 = *(char **)(param_1 + 0x40c);
LAB_00640458:
dVar4 = strtod(pcVar2,(char **)0x0);
pcVar2 = "";
local_18 = (float)dVar4;
if (2 < *(int *)param_1) {
pcVar2 = *(char **)(param_1 + 0x410);
}
dVar4 = strtod(pcVar2,(char **)0x0);
local_14 = (float)dVar4;
if (*(int *)param_1 == 4) {
dVar4 = strtod(*(char **)(param_1 + 0x414),(char **)0x0);
fVar3 = (float)dVar4;
}
local_10 = fVar3;
CBasePlayer::SnapEyeAngles(this,(QAngle *)&local_18);
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.