CBaseAbility::CreateForPlayer
0x004d27b0 · 372 bytes · __cdecl
_ZN12CBaseAbility15CreateForPlayerEP13CTerrorPlayer
Decompiled
undefined (1 param)
/* CBaseAbility::CreateForPlayer(CTerrorPlayer*) */
int * CBaseAbility::CreateForPlayer(CTerrorPlayer *param_1)
{
QAngle *pQVar1;
int iVar2;
undefined4 uVar3;
int *piVar4;
Vector local_28 [24];
if ((param_1 != (CTerrorPlayer *)0x0) &&
(iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar2 == 3)) {
(**(code **)(*(int *)param_1 + 0x234))(local_28,param_1);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
pQVar1 = (QAngle *)(param_1 + 0x37c);
uVar3 = (**(code **)(*(int *)param_1 + 0x544))(param_1);
switch(uVar3) {
default:
goto switchD_004d281c_caseD_0;
case 1:
piVar4 = (int *)CBaseEntity::Create("ability_tongue",local_28,pQVar1,(CBaseEntity *)param_1);
break;
case 2:
if (*(int *)(param_1 + 0x4018) == 1) {
piVar4 = (int *)CBaseEntity::Create("ability_selfdestruct",local_28,pQVar1,
(CBaseEntity *)param_1);
}
else {
piVar4 = (int *)CBaseEntity::Create("ability_vomit",local_28,pQVar1,(CBaseEntity *)param_1);
}
break;
case 3:
piVar4 = (int *)CBaseEntity::Create("ability_lunge",local_28,pQVar1,(CBaseEntity *)param_1);
break;
case 4:
piVar4 = (int *)CBaseEntity::Create("ability_spit",local_28,pQVar1,(CBaseEntity *)param_1);
break;
case 5:
piVar4 = (int *)CBaseEntity::Create("ability_leap",local_28,pQVar1,(CBaseEntity *)param_1);
break;
case 6:
piVar4 = (int *)CBaseEntity::Create("ability_charge",local_28,pQVar1,(CBaseEntity *)param_1);
break;
case 8:
piVar4 = (int *)CBaseEntity::Create("ability_throw",local_28,pQVar1,(CBaseEntity *)param_1);
}
if (piVar4 != (int *)0x0) {
(**(code **)(*piVar4 + 0x338))(piVar4,param_1);
return piVar4;
}
}
switchD_004d281c_caseD_0:
return (int *)0x0;
}
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.