problema plugin bhop

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
NemeSyS17
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

17 Sep 2017, 11:35

salut am o problema , la modul fuien + bhop , daca fac bhop si sunt in aer cu parasuta merge bine dar daca parasuta este activata cand ajung la pamant se opreste
eu tine apasat si "space" si "e" sa fac bhp u parauta dar cand ating pamantul nu mai functioneza bhop-ul se opreste ... !
de la parasuta nu e , m incercat mai multe pluinuri de parasuta , si tot asa , m gandesc ca e de la pluginul de bhop !
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN	"Bhop Abilities"
#define VERSION "0.5.2"
#define AUTHOR	"ConnorMcLeod"

#define MAX_PLAYERS	32

#define OFFSET_CAN_LONGJUMP    356 // VEN
#define BUNNYJUMP_MAX_SPEED_FACTOR 1.7

#define PLAYER_JUMP		6

new g_iCdWaterJumpTime[MAX_PLAYERS+1]
new bool:g_bAlive[MAX_PLAYERS+1]
new bool:g_bAutoBhop[MAX_PLAYERS+1]

new g_pcvarBhopStyle, g_pcvarAutoBhop, g_pcvarFallDamage
new g_pcvarGravity

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_cvar("bhop_abilities", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
	g_pcvarBhopStyle = register_cvar("bhop_style", "2")  // (1 : no slowdown, 2 : no speed limit)
	g_pcvarAutoBhop = register_cvar("bhop_auto", "1")
	g_pcvarFallDamage = register_cvar("mp_falldamage", "1.0")

	RegisterHam(Ham_Player_Jump, "player", "Player_Jump")
	register_forward(FM_UpdateClientData, "UpdateClientData")
	register_forward(FM_CmdStart, "CmdStart")
	RegisterHam(Ham_Spawn, "player", "Check_Alive", 1)
	RegisterHam(Ham_Killed, "player", "Check_Alive", 1)
	RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_player")

	register_concmd("amx_autobhop", "AdminCmd_Bhop", _, "<nick|#userid> <0|1>")

	g_pcvarGravity = get_cvar_pointer("sv_gravity")
}

public Check_Alive(id)
{
	g_bAlive[id] = bool:is_user_alive(id)
}

public Ham_TakeDamage_player(id, ent, idattacker, Float:damage, damagebits)
{
	if( damagebits != DMG_FALL )
		return HAM_IGNORED

	damage *= get_pcvar_float(g_pcvarFallDamage)
	SetHamParamFloat(4, damage)

	return HAM_HANDLED
}

public CmdStart(id, uc_handle, seed)
{
	if(get_user_flags(id) & read_flags("l"))
	{
		if(	g_bAlive[id]
		&&	get_pcvar_num(g_pcvarBhopStyle)
		&&	get_uc(uc_handle, UC_Buttons) & IN_USE
		&&	pev(id, pev_flags) & FL_ONGROUND	)
		{
			static Float:fVelocity[3]
			pev(id, pev_velocity, fVelocity)
			fVelocity[0] *= 0.3
			fVelocity[1] *= 0.3
			fVelocity[2] *= 0.3
			set_pev(id, pev_velocity, fVelocity)
		}
	}
}

public Player_Jump(id)
{
	if( !g_bAlive[id] || !(get_user_flags(id) & read_flags("a")))
	{
		return
	}
	
	static iBhopStyle ; iBhopStyle = get_pcvar_num(g_pcvarBhopStyle)
	if(!iBhopStyle)
	{
		static iOldButtons ; iOldButtons = pev(id, pev_oldbuttons)
		if( (get_pcvar_num(g_pcvarAutoBhop) || g_bAutoBhop[id]) && iOldButtons & IN_JUMP && pev(id, pev_flags) & FL_ONGROUND)
		{
			iOldButtons &= ~IN_JUMP
			set_pev(id, pev_oldbuttons, iOldButtons)
			set_pev(id, pev_gaitsequence, PLAYER_JUMP)
			set_pev(id, pev_frame, 0.0)
			return
		}
		return
	}

	if( g_iCdWaterJumpTime[id] )
	{
		//client_print(id, print_center, "Water Jump !!!")
		return
	}

	if( pev(id, pev_waterlevel) >= 2 )
	{
		return
	}

	static iFlags ; iFlags = pev(id, pev_flags)
	if( !(iFlags & FL_ONGROUND) )
	{
		return
	}

	static iOldButtons ; iOldButtons = pev(id, pev_oldbuttons)
	if( !get_pcvar_num(g_pcvarAutoBhop) && !g_bAutoBhop[id] && iOldButtons & IN_JUMP )
	{
		return
	}

	// prevent the game from making the player jump
	// as supercede this forward just fails
	set_pev(id, pev_oldbuttons, iOldButtons | IN_JUMP)

	static Float:fVelocity[3]
	pev(id, pev_velocity, fVelocity)

	if(iBhopStyle == 1)
	{
		static Float:fMaxScaledSpeed
		pev(id, pev_maxspeed, fMaxScaledSpeed)
		if(fMaxScaledSpeed > 0.0)
		{
			fMaxScaledSpeed *= BUNNYJUMP_MAX_SPEED_FACTOR
			static Float:fSpeed
			fSpeed = floatsqroot(fVelocity[0]*fVelocity[0] + fVelocity[1]*fVelocity[1] + fVelocity[2]*fVelocity[2])
			if(fSpeed > fMaxScaledSpeed)
			{
				static Float:fFraction
				fFraction = ( fMaxScaledSpeed / fSpeed ) * 0.65
				fVelocity[0] *= fFraction
				fVelocity[1] *= fFraction
				fVelocity[2] *= fFraction
			}
		}
	}

	static Float:fFrameTime, Float:fPlayerGravity
	global_get(glb_frametime, fFrameTime)
	pev(id, pev_gravity, fPlayerGravity)

	new iLJ
	if(	(pev(id, pev_bInDuck) || iFlags & FL_DUCKING)
	&&	get_pdata_int(id, OFFSET_CAN_LONGJUMP)
	&&	pev(id, pev_button) & IN_DUCK
	&&	pev(id, pev_flDuckTime)	)
	{
		static Float:fPunchAngle[3], Float:fForward[3]
		pev(id, pev_punchangle, fPunchAngle)
		fPunchAngle[0] = -5.0
		set_pev(id, pev_punchangle, fPunchAngle)
		global_get(glb_v_forward, fForward)

		fVelocity[0] = fForward[0] * 560
		fVelocity[1] = fForward[1] * 560
		fVelocity[2] = 299.33259094191531084669989858532
		iLJ = 1
	}
	else
	{
		fVelocity[2] = 268.32815729997476356910084024775
	}

	fVelocity[2] -= fPlayerGravity * fFrameTime * 0.5 * get_pcvar_num(g_pcvarGravity)

	set_pev(id, pev_velocity, fVelocity)

	set_pev(id, pev_gaitsequence, PLAYER_JUMP+iLJ)
	set_pev(id, pev_frame, 0.0)
}

public UpdateClientData(id, sendweapons, cd_handle)
{
	g_iCdWaterJumpTime[id] = get_cd(cd_handle, CD_WaterJumpTime)
}

public AdminCmd_Bhop(id, level, cid)
{
	if(!(get_user_flags(id) & read_flags("e")))
		return PLUGIN_HANDLED

	new szPlayer[32]
	read_argv(1, szPlayer, 31)
	new iPlayer = cmd_target(id, szPlayer, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS)

	if( !iPlayer )
	{
		return PLUGIN_HANDLED
	}

	if( read_argc() < 3 )
	{
		g_bAutoBhop[iPlayer] = !g_bAutoBhop[iPlayer]
	}
	else
	{
		new arg2[2]
		read_argv(2, arg2, 1)
		if(arg2[0] == '1' && !g_bAutoBhop[iPlayer])
		{
			g_bAutoBhop[iPlayer] = true
		}
		else if(arg2[0] == '0' && g_bAutoBhop[iPlayer])
		{
			g_bAutoBhop[iPlayer] = false
		}
	}

	client_print(id, print_console, "Player %s autobhop is currently : %s", szPlayer, g_bAutoBhop[iPlayer] ? "On" : "Off")
	return PLUGIN_HANDLED
}
RoyalServer
User avatar
E N T I U
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 07:14
Detinator Steam: Da
CS Status: Prin zona...
Fond eXtream: 0

18 Sep 2017, 10:24

1. Vezi sa ai cvar-ul "bhop_style" setat pe valoarea "2".
2. Inverseaza putin ordinea celor doua pluginuri.
User avatar
NemeSyS17
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

22 Sep 2017, 16:48

la fel face , altceva ????
User avatar
NemeSyS17
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

23 Sep 2017, 20:06

UP ?
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 0
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 4 times
Been thanked: 46 times

23 Sep 2017, 21:17

pune bhop_style pe 0
User avatar
NemeSyS17
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

24 Sep 2017, 01:12

m facut dar cu parasuta nu prinde viteza , adica faci viteza , dar cand atinge revine la viteza setata , unde este setata nu stiu !
DanteNikolase
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 27 Aug 2017, 05:30
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

24 Sep 2017, 06:06

Mai Degraba Foloseste Accest Bhop Are Viteza mare il modifici dupa bunul Plac
| Afiseaza codul
#include <amxmodx>

#include <engine>



#define	FL_WATERJUMP	(1<<11)	// player jumping out of water

#define	FL_ONGROUND	(1<<9)	// At rest / on the ground



public plugin_init() {

	register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")

	register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)



	register_cvar("bh_enabled", "1")

	register_cvar("bh_autojump", "1")

}



public client_PreThink(id) {

	if (!get_cvar_num("bh_enabled"))

		return PLUGIN_CONTINUE

	

//	if (get_user_team(id) != 2)

//		return PLUGIN_CONTINUE

	

	entity_set_float(id, EV_FL_fuser2, 0.0)		// Disable slow down after jumping



	if (!get_cvar_num("bh_autojump"))

		return PLUGIN_CONTINUE



// Code from CBasePlayer::Jump (player.cpp)		Make a player jump automatically

	if (entity_get_int(id, EV_INT_button) & 2) {	// If holding jump

		new flags = entity_get_int(id, EV_INT_flags)



		if (flags & FL_WATERJUMP)

			return PLUGIN_CONTINUE

		if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )

			return PLUGIN_CONTINUE

		if ( !(flags & FL_ONGROUND) )

			return PLUGIN_CONTINUE



		new Float:velocity[3]

		entity_get_vector(id, EV_VEC_velocity, velocity)

		velocity[2] += 250.0

		entity_set_vector(id, EV_VEC_velocity, velocity)



		entity_set_int(id, EV_INT_gaitsequence, 6)	// Play the Jump Animation

	}

	return PLUGIN_CONTINUE

}
Post Reply

Return to “Modificari pluginuri”

  • Information