I've hooked player::killed, however I'm having an issue with respawning the player on death.
Code:
void PlayerKilled_Hook(void *victim, entvars_t *attacker, int gib) {
//pre
reinterpret_cast<int (*)(void *, entvars_t *, int)>(gHook.pKilled)(victim, attacker, gib);
//post
*((int *)(*(entvars_t **)victim)->pContainingEntity->pvPrivateData + m_iNumRespawn) = 0;
}
It works for the first person that dies, then doesn't after that.
I'm testing right now with bots, so maybe that's whats messing it up?