Help c++

Rob

New member
Joined
Jun 27, 2018
Messages
4
Reaction score
0
Hi, I need some help to make an c++ samp spammer, pls :sadpepe:
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
Code:
bool spam = false;
while(true)
{
	if(GetAsyncKeyState(VK_SPACE) & 1)
	{
		spam = !spam;
		Sleep(600);
	}

	if(spam)
	ChatMsg("SPAMM!");

	Sleep(10);
}
what a difficult thing to make this... my gosh
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
151
user88 said:
Code:
bool spam = false;
while(true)
{
	if(GetAsyncKeyState(VK_SPACE) & 1)
	{
		spam = !spam;
		Sleep(600);
	}

	if(spam)
	ChatMsg("SPAMM!");

	Sleep(10);
}
what a difficult thing to make this... my gosh

[shcode=cpp]
while(true){
spamSamp();
}[/shcode]


Edit: what's the use of such code if there's no definition of spamSamp or ChatMsg...
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
user88 said:
Code:
bool spam = false;
while(true)
{
	if(GetAsyncKeyState(VK_SPACE) & 1)
	{
		spam = !spam;
		Sleep(600);
	}

	if(spam)
	ChatMsg("SPAMM!");

	Sleep(10);
}
what a difficult thing to make this... my gosh

what is ChatMsg ?
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
you can use definition from sobeit source, search for 'say' and just replace ChatMsg with say function :3 :urtheman:
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
151
Code:
#include "stdafx.h"
#include <windows.h>

#define SAMP_INFO  0x21A0F8
#define SAMP_POOLS 0x3CD
#define SAMP_FUNC_SAY  0x57F0

bool KeyPressed(BYTE key)
{
	return ((GetAsyncKeyState(key)&(1 << 16)) != 0);
}

void Thread()
{
	DWORD SampDLL = (DWORD)GetModuleHandleA("samp.dll");
	if (SampDLL)
	{
		DWORD *pInfo = (DWORD*)(SampDLL + SAMP_INFO);
		while (*pInfo == 0) Sleep(300);
		DWORD *pPools = (DWORD*)(*pInfo + SAMP_POOLS);
		DWORD *pPlayerPool = (DWORD*)(*pPools + 24);
		DWORD *pLocalPlayer = (DWORD*)(*pPlayerPool + 34);

		char msg[128] = "test\0";

		bool spam = false;
		while (true) {
			if (KeyPressed(VK_SPACE)) {
				spam = !spam;
				Sleep(700);
			}

			if (spam) {
				((void(__thiscall *) (void *_this, char *message)) (SampDLL + SAMP_FUNC_SAY)) (pLocalPlayer, msg);
				Sleep(1000);
			}
			Sleep(10);
		}
	}
}

int WINAPI DllMain(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
	if (reason == DLL_PROCESS_ATTACH)
	{
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Thread, 0, 0, 0);
	}
	return 1;
}

it's adapted from mod_sa source:
samp.h - offsets
samp.cpp - the way of calling the function (__thiscall line)
https://github.com/BlastHackNet/mod_s0beit_sa/releases
 

ini

Well-known member
Joined
Sep 28, 2015
Messages
321
Reaction score
115
pls dont help this user, he's just trolling,i can call him master of trolls.
 
Top