Code:
void DoTelekill(int TeleKill)
{
DWORD posptr, posy;
GetPlayerByIndex = (lpGetPlayerByIndex)PlayerByIndex;
unsigned long ulThis = *(unsigned long *)ClientInfoMgr;
GetLocalPlayer = (lpGetLocalPlayer)LocalPlayer;
posptr = (DWORD)GetModuleHandle("ClientFX.fxd");
posptr += ADDR_CLIENTFX;
memcpy(&posy,(void *)posptr, 4);
for(int i = 0; i < 16; i++)
{
PlayerInfo *pPlayer = GetPlayerByIndex(ulThis, i, 0);
PlayerInfo *pLocal = GetLocalPlayer(ulThis);
if(pPlayer != 0 && pPlayer->obj != 0 && pPlayer->IsDead == 0)
{
if(TeleKill)
{
if(pPlayer->Team != pLocal->Team)
{
*(float *)(posy + 0xC8) = (pPlayer->obj->origin.x + 100.0f);
*(float *)(posy + 0xCC) = (pPlayer->obj->origin.y + 100.0f);
*(float *)(posy + 0xD0) = (pPlayer->obj->origin.z);
}
}
}
}
}