Resolved Multi Jump For Humans

Unpaid Requests, Public Plugins
Post Reply
Turnedo
Member
Member
Morocco
Posts: 15
Joined: 2 Years Ago
Has thanked: 2 times
Been thanked: 0
Contact:

Multi Jump For Humans

#1

Post by Turnedo » 2 Years Ago

Hi Escapers Zone DEV Team !
I need to change the multi jump from all to humans only !

Code: Select all

 #include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
	register_plugin("MultiJump","1.1","twistedeuphoria")
	register_cvar("amx_maxjumps","1")
	register_cvar("amx_mjadminonly","0")
}

public client_putinserver(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
		{
			dojump[id] = true
			jumpnum[id]++
			return PLUGIN_CONTINUE
		}
	}
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}	
Thanks <3
Last edited by Raheem on 01 Sep 2017, 00:28, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 117 times
Age: 22
Contact:

#2

Post by Raheem » 2 Years Ago

We have already Multi-Jump plugin better than this one. You can use it, It's here: viewtopic.php?f=15&t=49

For humans only use:
  • Code: Select all

    #include <zombie_escape>
    
    // Variables
    new g_iJumpCount[33], bool:g_bGiveMultiJump[33]
    
    // Cvars
    new cvar_enable_multijump
    
    public plugin_init()
    {
    	register_plugin("[ZE] Multi-Jump", "1.1", "Raheem")
    	
    	// Hook Chains
    	RegisterHookChain(RG_CBasePlayer_Jump, "Fw_PlayerJump_Pre", 0)
    	
    	// Cvars
    	cvar_enable_multijump = register_cvar("ze_give_all_multijump", "0")
    }
    
    public plugin_natives()
    {
    	register_native("ze_give_user_multijump", "native_ze_give_user_multijump", 1)
    	register_native("ze_remove_user_multijump", "native_ze_remove_user_multijump", 1)
    }
    
    public Fw_PlayerJump_Pre(id)
    {
    	if (!is_user_alive(id))
    		return HC_SUPERCEDE
    	
    	new iFlags = get_entvar(id, var_flags)
    	
    	if (iFlags & FL_WATERJUMP || get_entvar(id, var_waterlevel) >= 2 || !(get_member(id, m_afButtonPressed) & IN_JUMP))
    		return HC_CONTINUE
    	
    	if (iFlags & FL_ONGROUND)
    	{
    		g_iJumpCount[id] = 0
    		return HC_CONTINUE
    	}
    	
    	if ((get_pcvar_num(cvar_enable_multijump) != 0 || g_bGiveMultiJump[id]) && !ze_is_user_zombie(id))
    	{
    		if (++g_iJumpCount[id] <= 1)
    		{
    			new Float:fVelocity[3]
    			get_entvar(id, var_velocity, fVelocity)
    			fVelocity[2] = 268.328157
    			set_entvar(id, var_velocity, fVelocity)
    			return HC_SUPERCEDE
    		}
    	}
    	return HC_CONTINUE
    }
    
    public ze_roundend()
    {
    	for(new i = 1; i <= get_member_game(m_nMaxPlayers); i++)
    	{
    		if(!is_user_connected(i))
    			continue
    		
    		g_bGiveMultiJump[i] = false
    	}
    }
    
    public native_ze_give_user_multijump(id)
    {
    	g_bGiveMultiJump[id] = true
    }
    
    public native_ze_remove_user_multijump(id)
    {
    	g_bGiveMultiJump[id] = false
    }
Loading Raheem's signature, Please wait...
Image

Turnedo
Member
Member
Morocco
Posts: 15
Joined: 2 Years Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#3

Post by Turnedo » 2 Years Ago

Thanks Bro Raheem !
You are here <3 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests