This is what I've now:
PHP Code:
DETOUR_DECL_STATIC10(Detour_FXFireBullets, void, Vector const&, vOrigin, QAngle const&, vAngles, int, weaponId, int, mode, int, seed, float, flSpread, float, a9, float, a10, float, a11, int, a12)
{
int iPlayerId;
__asm mov iPlayerId, ecx
int definitionIndex;
__asm mov definitionIndex, edx
// Trick the compiler into thinking that we're using ESI(to preserve it - just to be sure).
__asm mov esi, esi;
printf("playerID: %d\n", iPlayerId);
printf("definitionIndex: %d\n", definitionIndex);
printf("wpnId: %d\n", weaponId);
printf("mode: %d\n", mode);
printf("seed: %d\n", seed);
printf("spread: %f\n", flSpread);
/* Call original function.
* I had to manually 'construct' this call because the compiler was destroying register content while pushing the args. */
void *addr = DETOUR_STATIC_CALL(Detour_FXFireBullets);
__asm {
push a12
push a11
push a10
push a9
push flSpread
push seed
push mode
push weaponId
push vAngles
push vOrigin
mov edx, definitionIndex
mov ecx, iPlayerId
call addr
add esp, 0x28
}
}
Excuse the huge mess but I had to use inline assembly to call the function because the compiler would destroy the contents of edx, ecx if I call it via DETOUR_STATIC_CALL..
If you remove the call to the original function no bullets/shots will be networked, however you can still kill people with knife/nades.
iPlayerID has correct values, dunno about definitionIndex