View Single Post
Author Message
thatguyzp
Junior Member
Join Date: Mar 2009
Old 12-17-2012 , 00:34   Metamod respawn problem.
Reply With Quote #1

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?
thatguyzp is offline