View Single Post
XTN
Junior Member
Join Date: May 2016
Location: Germany/Cologne
Old 05-26-2016 , 09:21   Re: [CS:S/CS:GO] shavit's simple bhop timer (1.4b 21/September/2015)
Reply With Quote #485

If someone wants to know how to add HSW-Style.

shavit.inc
(change code to this)
Code:
#define MAX_STYLES 8
#define MAX_ZONES 7

// game types
enum ServerGame(+=1)
{
	Game_CSS = 0,
	Game_CSGO,
	Game_Unknown
};

// bhop styles
// enum - for easier customization of settings
enum BhopStyle(+=1)
{
	Style_Forwards = 0,
	Style_Sideways,
	Style_WOnly,
	Style_Scroll,
	Style_400Velocity,
	Style_AOnly,
	Style_DOnly,
	Style_HSW
};

#if defined USES_STYLE_PROPERTIES
#define STYLE_NONE				(0)
#define STYLE_AUTOBHOP			(1 << 0)
#define STYLE_BLOCK_W			(1 << 1)
#define STYLE_BLOCK_A			(1 << 2)
#define STYLE_BLOCK_S			(1 << 3)
#define STYLE_BLOCK_D			(1 << 4)
#define STYLE_EASYBHOP			(1 << 5)
#define STYLE_VEL_LIMIT			(1 << 6)
#define STYLE_HSW_ONLY			(1 << 7)

int gI_StyleProperties[MAX_STYLES] =
{
	STYLE_AUTOBHOP|STYLE_EASYBHOP, // Forwards
	STYLE_AUTOBHOP|STYLE_EASYBHOP|STYLE_BLOCK_A|STYLE_BLOCK_D, // Sideways
	STYLE_AUTOBHOP|STYLE_EASYBHOP|STYLE_BLOCK_A|STYLE_BLOCK_D|STYLE_BLOCK_S, // W-Only
	STYLE_EASYBHOP, // Scroll
	STYLE_VEL_LIMIT, // 400 Velocity
	STYLE_AUTOBHOP|STYLE_EASYBHOP|STYLE_BLOCK_W|STYLE_BLOCK_D|STYLE_BLOCK_S, // A-Only
	STYLE_AUTOBHOP|STYLE_EASYBHOP|STYLE_BLOCK_W|STYLE_BLOCK_A|STYLE_BLOCK_S, // D-Only
	STYLE_AUTOBHOP|STYLE_EASYBHOP|STYLE_BLOCK_S|STYLE_HSW_ONLY // HSW
};

#define VELOCITY_UNLIMITED 0.0

// only applies if STYLE_VEL_LIMIT is defined for a style
// use VELOCITY_UNLIMITED to ignore
float gF_VelocityLimit[MAX_STYLES] =
{
	VELOCITY_UNLIMITED, // Forwards
	VELOCITY_UNLIMITED, // Sideways
	VELOCITY_UNLIMITED, // W-Only
	VELOCITY_UNLIMITED, // Scroll
	400.00, // 400 Velocity
	VELOCITY_UNLIMITED, // A-Only
	VELOCITY_UNLIMITED, // D-Only
	VELOCITY_UNLIMITED // HSW
};
#endif

#if defined USES_STYLE_NAMES
// style names
char gS_BhopStyles[MAX_STYLES][] =
{
	"Autobhop",
	"Sideways",
	"W-Only",
	"Scroll",
	"400 Velocity",
	"A-Only",
	"D-Only",
	"Half-Sideways"
};
#endif

#if defined USES_STYLE_HTML_COLORS
// style HTML colors, for CS:GO HUD
char gS_StyleHTMLColors[MAX_STYLES][] =
{
	"797FD4",
	"B54CB3",
	"9A59F0",
	"279BC2",
	"C9BB8B",
	"00FF40",
	"00FF40",
	"B54CBB"
};
#endif

#if defined USES_SHORT_STYLE_NAMES
// short names - up to 4 characters please
char gS_ShortBhopStyles[MAX_STYLES][] =
{
	"AUTO",
	"SW",
	"W",
	"LEGIT",
	"400VEL",
	"A-ONLY",
	"D-ONLY",
	"HSW"
};
#endif
shavit-core.sp
add this code in line 806 after the STYLE_BLOCK's

Code:
// HSW
if(gI_StyleProperties[gBS_Style[client]] & STYLE_HSW_ONLY && !bOnLadder)
{
	if(vel[0] == 0)
	{
		bEdit = true;
		vel[1] = 0.0;
		buttons &= ~IN_MOVELEFT;
		vel[1] = 0.0;
		buttons &= ~IN_MOVERIGHT;
	}
}
btw. ^ this removes the bug/exploit that players hold W and S and can strafe normally like on Forward Style.

@shavit
Add this please
XTN is offline