Internal BHop

Posts 1–10 of 10 · Page 1 of 1
Internal BHop
Agh man I hate asking stupid questions... but

Code:
bool __stdcall CreateMove(float flInputSampleTime, CUserCmd *cmd) {
	oCreateMove(flInputSampleTime, cmd);
	
	/* BHOP */

	CBaseEntity* pLocalPlayer = (CBaseEntity*)Interfaces->ClientEntList->GetClientEntity(Interfaces->Engine->GetLocalPlayer());

	int groundflags[] = { 257, 259, 269, 233 };

	if (GetAsyncKeyState(VK_SPACE))
	{
		for (int i = 0; i < 4; i++)
		{
			if (pLocalPlayer->GetFlags() == groundflags[i])
			{
				cmd->buttons |= IN_JUMP;

				continue;
			}
		}

		Msg("%s\n" "jump debug");
	}

	return true;
}
The problem is when you're holding space, the game is still holding +jump, so cmd->buttons |= IN_JUMP does nothing.

How do I get around this?
hmmm try if (pLocalPlayer->GetFlags() == groundflags[i])
{
cmd->buttons |= IN_JUMP; then
return

cmd -> button | = IN_JUMP;

continue;
Just another thing that will work better...

You code:
Code:
if (GetAsyncKeyState(VK_SPACE))
	{
The code:
Code:
if (GetAsyncKeyState(32 /* VK of SPACE */) & 0x8000 /* Key hold */)
	{
Code:
#define FL_ONGROUND (1<<0)

if(cmd->buttons & IN_JUMP && !(pLocal->GetFlags() & FL_ONGROUND))
	cmd->buttons &= ~IN_JUMP;
Credits: Snorflake
thanks guys
Quote Originally Posted by sethxi View Post
Agh man I hate asking stupid questions... but

Code:
bool __stdcall CreateMove(float flInputSampleTime, CUserCmd *cmd) {
	oCreateMove(flInputSampleTime, cmd);
	
	/* BHOP */

	CBaseEntity* pLocalPlayer = (CBaseEntity*)Interfaces->ClientEntList->GetClientEntity(Interfaces->Engine->GetLocalPlayer());

	int groundflags[] = { 257, 259, 269, 233 };

	if (GetAsyncKeyState(VK_SPACE))
	{
		for (int i = 0; i < 4; i++)
		{
			if (pLocalPlayer->GetFlags() == groundflags[i])
			{
				cmd->buttons |= IN_JUMP;

				continue;
			}
		}

		Msg("%s\n" "jump debug");
	}

	return true;
}
The problem is when you're holding space, the game is still holding +jump, so cmd->buttons |= IN_JUMP does nothing.

How do I get around this?
why are you checking for a certain key? just check for flags, then check if the player is on ground. if he is |= ~IN_JUMP;

- - - Updated - - -

oh sorry didnt read down far enough what i said is un needed.
There are so many things wrong with this
Woah.. you have hooked CreateMove totally wrong m8.
And to make the player jump, use


Defines:

Code:
#define	FL_ONGROUND				(1<<0)	// At rest / on the ground
#define FL_DUCKING				(1<<1)	// Player flag -- Player is fully crouched
#define	FL_WATERJUMP			(1<<3)	// player jumping out of water
#define FL_ONTRAIN				(1<<4) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
#define FL_INRAIN				(1<<5)	// Indicates the entity is standing in rain
#define FL_FROZEN				(1<<6) // Player is frozen for 3rd person camera
#define FL_ATCONTROLS			(1<<7) // Player can't move, but keeps key inputs for controlling another entity
#define	FL_CLIENT				(1<<8)	// Is a player
#define FL_FAKECLIENT			(1<<9)	// Fake client, simulated server side; don't send network messages to them
#define	FL_INWATER				(1<<10)	// In water
Code:
if(GetAsyncKeyState(VK_SPACE) && !(pLocalEnitity->Flags() & FL_ONGROUND) {
cmd->buttons &= ~IN_JUMP
}
- - - Updated - - -

Quote Originally Posted by sethxi View Post
Agh man I hate asking stupid questions... but

Code:
bool __stdcall CreateMove(float flInputSampleTime, CUserCmd *cmd) {
	oCreateMove(flInputSampleTime, cmd);
	
	/* BHOP */

	CBaseEntity* pLocalPlayer = (CBaseEntity*)Interfaces->ClientEntList->GetClientEntity(Interfaces->Engine->GetLocalPlayer());

	int groundflags[] = { 257, 259, 269, 233 };

	if (GetAsyncKeyState(VK_SPACE))
	{
		for (int i = 0; i < 4; i++)
		{
			if (pLocalPlayer->GetFlags() == groundflags[i])
			{
				cmd->buttons |= IN_JUMP;

				continue;
			}
		}

		Msg("%s\n" "jump debug");
	}

	return true;
}
The problem is when you're holding space, the game is still holding +jump, so cmd->buttons |= IN_JUMP does nothing.

How do I get around this?
Also, you have forgot verifiedlist etc.
Contact me on skype and i will teach you how you can make one Working CreateMove hook.
Click on my skype icon Under my profile picture. <---------------- or add, bjorn_tssgaming
Quote Originally Posted by viking911 View Post
Woah.. you have hooked CreateMove totally wrong m8.
And to make the player jump, use


Defines:

Code:
#define	FL_ONGROUND				(1<<0)	// At rest / on the ground
#define FL_DUCKING				(1<<1)	// Player flag -- Player is fully crouched
#define	FL_WATERJUMP			(1<<3)	// player jumping out of water
#define FL_ONTRAIN				(1<<4) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
#define FL_INRAIN				(1<<5)	// Indicates the entity is standing in rain
#define FL_FROZEN				(1<<6) // Player is frozen for 3rd person camera
#define FL_ATCONTROLS			(1<<7) // Player can't move, but keeps key inputs for controlling another entity
#define	FL_CLIENT				(1<<8)	// Is a player
#define FL_FAKECLIENT			(1<<9)	// Fake client, simulated server side; don't send network messages to them
#define	FL_INWATER				(1<<10)	// In water
Code:
if(GetAsyncKeyState(VK_SPACE) && !(pLocalEnitity->Flags() & FL_ONGROUND) {
cmd->buttons &= ~IN_JUMP
}
- - - Updated - - -



Also, you have forgot verifiedlist etc.
Contact me on skype and i will teach you how you can make one Working CreateMove hook.
Click on my skype icon Under my profile picture. <---------------- or add, bjorn_tssgaming
but the createmove hook works fine?
Quote Originally Posted by cdrizzle View Post
but the createmove hook works fine?
I dont see whats wrong with his createmove. Although i dont suggest checking for a key.
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us