int main()
{
// Remember, we have to call the original later
void( _cdecl *orig_CG_EntityEvent )( centity_t* cent, vec3_t position );
void CG_Event_Hook( centity_t* cent, vec3_t position )
{
entityState_t *es;
int cgEntEvent;
// defnitions
es = ¢->currentState;
event = es->event & ~EV_EVENT_BITS;
// Removed every piece of code we don't need for our hook
// event in which death takes place
if( cgEntEvent == EV_OBITUARY )
{
// we call the killspam we're going to make in here
cKillSpam( es );
// same goes for the killsounds
cKillSounds( es );
}
// call the original
orig_CG_EntityEvent(cent, position);
}
void cKillSpam( entityState_t *est )
{
// define myself and the the enemy
int cTarget = est->otherEntityNum;
int cAttacker = est->otherEntityNum2;
// the name of the target / enemy
char* cTargetName = cgs->clientinfo[cTarget].name;
// check if you're alive
if( cg->snap->ps.stats[STAT_HEALTH] > 0 )
{
// check if you aren't committing suicide
if( cAttacker == cg->snap->ps.clientNum && cTarget != cg->snap->ps.clientNum )
{
char kSpam[64];
// say it!
sprintf( kSpam, "say ^9Haha! ^1%s ^9Got Owned On ^0[)^1DoD^0(] ^9Server !\n", cTargetName );
pSendCommand( kSpam );
}
}
return 0;
}
Bookmarks