Raised This Month: $51 Target: $400
 12% 

Simple Plugin (probaly can be coded quick)


Post New Thread Reply   
 
Thread Tools Display Modes
Caesar
BANNED
Join Date: Nov 2004
Old 01-07-2006 , 02:31  
Reply With Quote #11

bump
Caesar is offline
l0calh0st
Junior Member
Join Date: Jan 2006
Old 01-07-2006 , 07:56  
Reply With Quote #12

Should work, didn't test it:

Code:
/*
 *
 *	Author:		Cheesy Peteza + l0calh0st
 *	Date:		22-Apr-2004 (updated 2-March-2005)
 *
 *
 *	Description:	Enable bunny hopping in Counter-Strike.
 *
 *	Cvars:
 *			bh_enabled		1 to enable this plugin, 0 to disable.
 *			bh_autojump		If set to 1 players just need to hold down jump to bunny hop (no skill required)
 *			bh_showusage		If set to 1 it will inform joining players that bunny hopping has been enabled
 *						and how to use it if bh_autojump enabled.
 *
 *	Concmds:
 *			bh_toggle		Toggles Bunnyhopping
 *
 *	Requirements:	AMXModX 0.16 or greater
 *
 *
 */

#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 + l0cal")
	register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
	
	register_concmd("bh_toggle", "bh_toggle", ADMIN_LEVEL_A, "Toggles Bunnyhopping")
	
	register_cvar("bh_enabled", "1")
	register_cvar("bh_autojump", "1")
	register_cvar("bh_showusage", "1")
}

public client_PreThink(id) {
	if (!get_cvar_num("bh_enabled"))
		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
}

public client_authorized(id)
	set_task(30.0, "showUsage", id)

public showUsage(id) {
	if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
		return PLUGIN_HANDLED

	if ( !get_cvar_num("bh_autojump") ) {
		client_print(id, print_chat, "[AMX] Bunny hopping is enabled on this server. You will not slow down after jumping.")
	} else {
		client_print(id, print_chat, "[AMX] Auto bunny hopping is enabled on this server. Just hold down jump to bunny hop.")
	}
	return PLUGIN_HANDLED
}

public bh_toggle() {
	if (!get_cvar_num("bh_enabled"))
		set_cvar_num("bh_enabled", 1)
	else 
		set_cvar_num("bh_enabled", 0)
	return PLUGIN_HANDLED
}
console command is bh_toggle

Currently needes ADMIN_LEVEL_C, if needed change the line 33:

register_concmd("bh_toggle", "bh_toggle", ADMIN_LEVEL_A, "Toggles Bunnyhopping")
to
register_concmd("bh_toggle", "bh_toggle", ADMIN_LEVEL_[your_flag_here], "Toggles Bunnyhopping")
l0calh0st is offline
Send a message via ICQ to l0calh0st
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-07-2006 , 09:33  
Reply With Quote #13

no, that will not work.
this will:
Code:
/* * *   Author:      Cheesy Peteza + l0calh0st *   Date:      22-Apr-2004 (updated 2-March-2005) * * *   Description:   Enable bunny hopping in Counter-Strike. * *   Cvars: *         bh_enabled      1 to enable this plugin, 0 to disable. *         bh_autojump      If set to 1 players just need to hold down jump to bunny hop (no skill required) *         bh_showusage      If set to 1 it will inform joining players that bunny hopping has been enabled *                  and how to use it if bh_autojump enabled. * *   Concmds: *         bh_toggle      Toggles Bunnyhopping * *   Requirements:   AMXModX 0.16 or greater * * */ #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 + l0cal")     register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)         register_concmd("bh_toggle", "bh_toggle", ADMIN_LEVEL_A, "Toggles Bunnyhopping")         register_cvar("bh_enabled", "1")     register_cvar("bh_autojump", "1")     register_cvar("bh_showusage", "1") } public client_PreThink(id) {     if (!get_cvar_num("bh_enabled"))         return PLUGIN_CONTINUE     if ( ! ( get_user_flags(id) & ADMIN_LEVEL_C ) )         return PLUGIN_HANDLED         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 } public client_authorized(id)     set_task(30.0, "showUsage", id) public showUsage(id) {     if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )         return PLUGIN_HANDLED         if ( !get_cvar_num("bh_autojump") ) {         client_print(id, print_chat, "[AMX] Bunny hopping is enabled on this server. You will not slow down after jumping.")         } else {         client_print(id, print_chat, "[AMX] Auto bunny hopping is enabled on this server. Just hold down jump to bunny hop.")     }     return PLUGIN_HANDLED } public bh_toggle() {     if (!get_cvar_num("bh_enabled"))         set_cvar_num("bh_enabled", 1)     else     set_cvar_num("bh_enabled", 0)     return PLUGIN_HANDLED }
[ --<-@ ] Black Rose is offline
l0calh0st
Junior Member
Join Date: Jan 2006
Old 01-07-2006 , 15:12  
Reply With Quote #14

Whoops, missunderstand by me... thought the toggle should be available for admins with ADMIN_FLAG_C...
l0calh0st is offline
Send a message via ICQ to l0calh0st
Caesar
BANNED
Join Date: Nov 2004
Old 01-08-2006 , 17:18  
Reply With Quote #15

Thanks everyone for the stuff it works now love yah!
Caesar is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode