C++ COD4 - MW: Kill Spammer/Hud Spammer
Sry for my English :D
It can work for every COD if you change the offsets
I hope i can help anyone with my idea.
If you have problams with this:
-test if you have the actuel offsets
-test the code, it can be that i forgot anything
Code:
static void(*TextHUD)(int pos, const char *name, ...) = (void(__cdecl *)(int, const char *, ...))0x4FCBC0;
static void(*CG_trap_SendConsoleCommand)(int x, int x2, char *cvar) = (void(__cdecl *)(int, int, char *))0x4F9AB0;
typedef enum
{
UNKNOWN,
CONSOLE,
KILLPOSITION,
CENTER,
} hud_t;
int spre = 0;
int spreupdate;
int myname;
int killscreen;
int Spamm = 0;
int SpammType;
void MsgSpam()
{
if (GetAsyncKeyState(VK_TAB))
{
SpammType = !SpammType;
}
if (SpammType == 0)
{
char S[85];
sprintf_s(S, "say ^1%s ^5Get ^1O^2W^3N^4E^5D ^1by %s", 0x00743CDF, 0x05A7B1B4); //first adress (0x00743CDF) is the name of the guy that you killed, it can bug, the next adress is your name
CG_trap_SendConsoleCommand(0, 0, S);
}
else
{
TextHUD(CENTER, "say ^1%s ^5Get ^1O^2W^3N^4E^5D ^1by %s", 0x00743CDF, 0x05A7B1B4);
}
}
void Spammers()
{
spreupdate = ... ; // this is the killstreak adress !!I cant give you the adress. ever when I found the right killstreak adress on the next start the adress changed!!
if (spreupdate == 0)
{
spre = 0;
}
else if (spreupdate > spre)
{
MsgSpam();
spre = spreupdate;
}
}