HelpTriggerbot help

Posts 1–15 of 19 · Page 1 of 2
Triggerbot help
The triggerbot is crashing whenever i press the triggerkey, i cannot figure out why tho...

.cpp
Code:
#include "CVars.h"
#include "Trigger.h"


void CTrigger::Main(CUserCmd* cmd)
{

IClientEntity* m_pLokal = (IClientEntity*)Interfacez.EntList->GetClientEntiti(Interfacez.Engine->GetLocalPlayer());

if (GetAsyncKeyState(Snyd.CVarz->Trigger_ActivationKey))
	{
		int cross = m_pLokal->InCross();
		if (cross > 0 && cross <= 64)
		{
			IClientEntity* target = (IClientEntity*)Interfacez.EntList->GetClientEntiti(cross);
			if (!target->IsDormant() && target->GetTeamNum() != m_pLokal->GetTeamNum())
			{
				cmd->buttons |= IN_ATTACK;
			}
		}
	}
};
.h
Code:
#include "SDK.h"

class CSpiller;
class CTrigger
{
public:

	void			Main(CUserCmd* cmd);

private:
	CUserCmd*	cmd;
	CSpiller*	m_pLokal;

};
Quote Originally Posted by sikaknight View Post
The triggerbot is crashing whenever i press the triggerkey, i cannot figure out why tho...

.cpp
Code:
#include "CVars.h"
#include "Trigger.h"


void CTrigger::Main(CUserCmd* cmd)
{

IClientEntity* m_pLokal = (IClientEntity*)Interfacez.EntList->GetClientEntiti(Interfacez.Engine->GetLocalPlayer());

if (GetAsyncKeyState(Snyd.CVarz->Trigger_ActivationKey))
	{
		int cross = m_pLokal->InCross();
		if (cross > 0 && cross <= 64)
		{
			IClientEntity* target = (IClientEntity*)Interfacez.EntList->GetClientEntiti(cross);
			if (!target->IsDormant() && target->GetTeamNum() != m_pLokal->GetTeamNum())
			{
				cmd->buttons |= IN_ATTACK;
			}
		}
	}
};
.h
Code:
#include "SDK.h"

class CSpiller;
class CTrigger
{
public:

	void			Main(CUserCmd* cmd);

private:
	CUserCmd*	cmd;
	CSpiller*	m_pLokal;

};

try replace cmd->buttons |= IN_ATTACK; for a simple SendMessage and tell me if it still crashing

also vac don't read your vars names, u dont need to do a plokal, just do plocal, they cant read your variables names :lol:
Quote Originally Posted by gabrielalbin0 View Post
try replace cmd->buttons |= IN_ATTACK; for a simple SendMessage and tell me if it still crashing

also vac don't read your vars names, u dont need to do a plokal, just do plocal, they cant read your variables names :lol:
I have named all variables in danish

I tried making it a Mouse event instead, but still crashing as soon as i press the triggerkey
Quote Originally Posted by sikaknight View Post
I have named all variables in danish

I tried making it a Mouse event instead, but still crashing as soon as i press the triggerkey
Attach your debugger and look where it's crashing. Either your interface is a nullptr or your returned entites.
Quote Originally Posted by WasserEsser View Post
Attach your debugger and look where it's crashing. Either your interface is a nullptr or your returned entites.
All my interfaces was nullptr, i fixed it tho.
And i also attached a debugger, it is crashing at InCross.
Quote Originally Posted by sikaknight View Post
All my interfaces was nullptr, i fixed it tho.
And i also attached a debugger, it is crashing at InCross.
Did you fix the problem or do you still crash?
Quote Originally Posted by WasserEsser View Post
Did you fix the problem or do you still crash?
Still crashing. But i noticed that my InCross offset was outdated, but still crashing tho.. :/

Code:
	int InCross()
	{
		return *(int*)(this + 0xAA44);
	}
Quote Originally Posted by sikaknight View Post
Still crashing. But i noticed that my InCross offset was outdated, but still crashing tho.. :/

Code:
	int InCross()
	{
		return *(int*)(this + 0xAA44);
	}
Cast the 'this' ptr into a dword before adding 0xAA44 to it. Due to pointer arithmetic, what's happening is actually this + 0xAA44 * sizeof( the class the this ptr belongs to )
Quote Originally Posted by WasserEsser View Post
Cast the 'this' ptr into a dword before adding 0xAA44 to it. Due to pointer arithmetic, what's happening is actually this + 0xAA44 * sizeof( the class the this ptr belongs to )
So you mean like this?

Code:
	int InCross()
	{
		return *(int*)((DWORD)this + 0xAA44);
	}
If not then i dont quite understand
Quote Originally Posted by sikaknight View Post
So you mean like this?

Code:
	int InCross()
	{
		return *(int*)((DWORD)this + 0xAA44);
	}
If not then i dont quite understand
Yes, like this.
Quote Originally Posted by WasserEsser View Post
Yes, like this.
Yea still crashing but not its crashing at the Trigger.cpp

Code:
#include "CVars.h"
#include "Trigger.h"


void CTrigger::Main(CUserCmd* cmd)
{

IClientEntity* m_pLokal = (IClientEntity*)Interfacez.EntList->GetClientEntiti(Interfacez.Engine->GetLocalPlayer());

if (GetAsyncKeyState(Snyd.CVarz->Trigger_ActivationKey))
	{
		int cross = m_pLokal->InCross();
		if (cross > 0 && cross <= 64)
		{
			IClientEntity* target = (IClientEntity*)Interfacez.EntList->GetClientEntiti(cross);
			if (!target->IsDormant() && target->GetTeamNum() != m_pLokal->GetTeamNum())
			{
				cmd->buttons |= IN_ATTACK;
			}
		}
	}
};

At the int cross = m_pLokal->InCross();
you dont need to loop truth 64 player just use (ClientAdress + Entitylist + (yourcrosshair - 1) * 0x10) and then read there team info after that you do
if( youcrosshair > 0 && thereteam != yourteam)
sleep(8)
shoot
sleep(1)
notshoot
Quote Originally Posted by TheNamless View Post
you dont need to loop truth 64 player just use (ClientAdress + Entitylist + (yourcrosshair - 1) * 0x10) and then read there team info after that you do
if( youcrosshair > 0 && thereteam != yourteam)
sleep(8)
shoot
sleep(1)
notshoot
Where is he looping through 64 players?
Make sure pLocal is not a nullptr.
Posts 1–15 of 19 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us