Test_RandomPlayerPosition
0x00af2c50 · 277 bytes · unknown
_Z25Test_RandomPlayerPositionv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Test_RandomPlayerPosition() */
void Test_RandomPlayerPosition(void)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
undefined4 uVar4;
CBasePlayer *this;
int iVar5;
longdouble lVar6;
float local_18;
float local_14;
float local_10;
this = (CBasePlayer *)UTIL_GetLocalPlayer();
iVar5 = GetWorldEntity();
if (this == (CBasePlayer *)0x0) {
Error("Test_RandomPlayerPosition: no local player entity.");
}
else if (iVar5 == 0) {
Error("Test_RandomPlayerPosition: no world entity.");
}
uVar1 = *(undefined4 *)(iVar5 + 0x44c);
uVar2 = *(undefined4 *)(iVar5 + 0x450);
uVar3 = *(undefined4 *)(iVar5 + 0x458);
uVar4 = *(undefined4 *)(iVar5 + 0x45c);
lVar6 = (longdouble)RandomFloat(*(undefined4 *)(iVar5 + 0x448),*(undefined4 *)(iVar5 + 0x454));
local_18 = (float)lVar6;
lVar6 = (longdouble)RandomFloat(uVar1,uVar3);
local_14 = (float)lVar6;
lVar6 = (longdouble)RandomFloat(uVar2,uVar4);
local_10 = (float)lVar6;
CBasePlayer::ForceOrigin(this,(Vector *)&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.