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

[REQ] BB zm CLASS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dote
Member
Join Date: Jan 2018
Old 04-19-2018 , 04:44   [REQ] BB zm CLASS
Reply With Quote #1

hi guys
i want a zombie class for my base builder server like bunny jump ore lockedz but i cant add zp class plugins to my base builder can u give me a example?! thx
Dote is offline
spooky HL15
Member
Join Date: Oct 2015
Old 04-19-2018 , 15:22   Re: [REQ] BB zm CLASS
Reply With Quote #2

what you mean by bunny jump ?
do you mean
zombie [Bunny Hop]
Code:
#include <amxmodx>
#include <fakemeta>
#include <basebuilder>

new g_zclass_bhzombie

new g_hasBhop[ 33 ]
new pcvar_enabled, pcvar_autojump

new bool:g_restorevel[33]
new Float:g_velocity[33][3]

new const zclass_name[] = { "Big Zombie" }
new const zclass_info[] = { "\r[Health 3000] \y[Bunny Hop]" }
new const zclass_model[] = { "zombie_big" }
new const zclass_clawmodel[] = { "basebulder/v_big" }
const zclass_health = 3000
const zclass_speed = 250
const Float:zclass_gravity = 0.9
const Float:zclass_knockback = 0.0

public plugin_init()
{
        register_plugin("Zombie Class: Big", "1.1", "spooky")

	register_event( "DeathMsg", "event_player_death", "a" )

	pcvar_enabled = register_cvar( "zp_bhzombie_bunnyhop_enabled", "1" )
	pcvar_autojump = register_cvar( "zp_bhzombie_autojump", "1" )

	register_forward( FM_PlayerPreThink, "forward_prethink" )
}

public plugin_precache()
{
	g_zclass_bhzombie = bb_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)

	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink_Post", 1)
}

public zp_user_infected_post(id, infector)
{
	if (bb_get_user_zombie_class(id) == g_zclass_bhzombie)
	{
		g_hasBhop[ id ] = true

		pev(id, pev_velocity, g_velocity[id])
	}
}

public client_connect( id )
{
	g_hasBhop[ id ] = false
}

public event_player_death()
{
	g_hasBhop[ read_data( 2 ) ] = false
}

public forward_prethink( id )
{
	if(!is_user_alive(id) || !bb_is_user_zombie(id))
 		return PLUGIN_CONTINUE

        if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return PLUGIN_CONTINUE

	if( get_pcvar_num( pcvar_enabled ) )
	{
		set_pev( id, pev_fuser2, 0.0 )
		
		if( get_pcvar_num( pcvar_autojump ) && pev( id, pev_button ) & IN_JUMP )
		{
			new szFlags = pev( id, pev_flags )
			if( !( szFlags & FL_WATERJUMP ) && pev( id, pev_waterlevel ) < 2 && szFlags & FL_ONGROUND )
			{
				new Float: szVelocity[ 3 ]
				pev( id, pev_velocity, szVelocity)
				szVelocity[ 2 ] += 250.0
				set_pev( id, pev_velocity, szVelocity )
				set_pev( id, pev_gaitsequence, 6 )
			}
		}
	}
        return FMRES_IGNORED
}

public fw_PlayerPreThink(id)
{	
	if ( !is_user_alive(id) || !is_user_bot(id) || !bb_is_user_zombie(id) )
		return FMRES_IGNORED
	
	if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return FMRES_IGNORED
		
	if (pev(id, pev_flags) & FL_ONGROUND)
	{
		pev(id, pev_velocity, g_velocity[id])
        
		g_restorevel[id] = true
	}
	return FMRES_IGNORED
}

public fw_PlayerPreThink_Post(id)
{
	if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return FMRES_IGNORED
		
	if (g_restorevel[id])
	{
		g_restorevel[id] = false

		if (!(pev(id, pev_flags) & FL_ONTRAIN))
		{
			new groundent = pev(id, pev_groundentity)
			
			if (pev_valid(groundent) && (pev(groundent, pev_flags) & FL_CONVEYOR))
			{	
				static Float:vecTemp[3]
                
				pev(id, pev_basevelocity, vecTemp)
                
				g_velocity[id][0] += vecTemp[0]
				g_velocity[id][1] += vecTemp[1]
				g_velocity[id][2] += vecTemp[2]
			}                

			set_pev(id, pev_velocity, g_velocity[id])
            
			return FMRES_HANDLED
		}
	}
	return FMRES_IGNORED
}
spooky HL15 is offline
Dote
Member
Join Date: Jan 2018
Old 04-21-2018 , 12:15   Re: [REQ] BB zm CLASS
Reply With Quote #3

Quote:
Originally Posted by spooky HL15 View Post
what you mean by bunny jump ?
do you mean
zombie [Bunny Hop]
Code:
#include <amxmodx>
#include <fakemeta>
#include <basebuilder>

new g_zclass_bhzombie

new g_hasBhop[ 33 ]
new pcvar_enabled, pcvar_autojump

new bool:g_restorevel[33]
new Float:g_velocity[33][3]

new const zclass_name[] = { "Big Zombie" }
new const zclass_info[] = { "\r[Health 3000] \y[Bunny Hop]" }
new const zclass_model[] = { "zombie_big" }
new const zclass_clawmodel[] = { "basebulder/v_big" }
const zclass_health = 3000
const zclass_speed = 250
const Float:zclass_gravity = 0.9
const Float:zclass_knockback = 0.0

public plugin_init()
{
        register_plugin("Zombie Class: Big", "1.1", "spooky")

	register_event( "DeathMsg", "event_player_death", "a" )

	pcvar_enabled = register_cvar( "zp_bhzombie_bunnyhop_enabled", "1" )
	pcvar_autojump = register_cvar( "zp_bhzombie_autojump", "1" )

	register_forward( FM_PlayerPreThink, "forward_prethink" )
}

public plugin_precache()
{
	g_zclass_bhzombie = bb_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)

	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink_Post", 1)
}

public zp_user_infected_post(id, infector)
{
	if (bb_get_user_zombie_class(id) == g_zclass_bhzombie)
	{
		g_hasBhop[ id ] = true

		pev(id, pev_velocity, g_velocity[id])
	}
}

public client_connect( id )
{
	g_hasBhop[ id ] = false
}

public event_player_death()
{
	g_hasBhop[ read_data( 2 ) ] = false
}

public forward_prethink( id )
{
	if(!is_user_alive(id) || !bb_is_user_zombie(id))
 		return PLUGIN_CONTINUE

        if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return PLUGIN_CONTINUE

	if( get_pcvar_num( pcvar_enabled ) )
	{
		set_pev( id, pev_fuser2, 0.0 )
		
		if( get_pcvar_num( pcvar_autojump ) && pev( id, pev_button ) & IN_JUMP )
		{
			new szFlags = pev( id, pev_flags )
			if( !( szFlags & FL_WATERJUMP ) && pev( id, pev_waterlevel ) < 2 && szFlags & FL_ONGROUND )
			{
				new Float: szVelocity[ 3 ]
				pev( id, pev_velocity, szVelocity)
				szVelocity[ 2 ] += 250.0
				set_pev( id, pev_velocity, szVelocity )
				set_pev( id, pev_gaitsequence, 6 )
			}
		}
	}
        return FMRES_IGNORED
}

public fw_PlayerPreThink(id)
{	
	if ( !is_user_alive(id) || !is_user_bot(id) || !bb_is_user_zombie(id) )
		return FMRES_IGNORED
	
	if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return FMRES_IGNORED
		
	if (pev(id, pev_flags) & FL_ONGROUND)
	{
		pev(id, pev_velocity, g_velocity[id])
        
		g_restorevel[id] = true
	}
	return FMRES_IGNORED
}

public fw_PlayerPreThink_Post(id)
{
	if (bb_get_user_zombie_class(id) != g_zclass_bhzombie)
		return FMRES_IGNORED
		
	if (g_restorevel[id])
	{
		g_restorevel[id] = false

		if (!(pev(id, pev_flags) & FL_ONTRAIN))
		{
			new groundent = pev(id, pev_groundentity)
			
			if (pev_valid(groundent) && (pev(groundent, pev_flags) & FL_CONVEYOR))
			{	
				static Float:vecTemp[3]
                
				pev(id, pev_basevelocity, vecTemp)
                
				g_velocity[id][0] += vecTemp[0]
				g_velocity[id][1] += vecTemp[1]
				g_velocity[id][2] += vecTemp[2]
			}                

			set_pev(id, pev_velocity, g_velocity[id])
            
			return FMRES_HANDLED
		}
	}
	return FMRES_IGNORED
}
fixed thx


بهط
Dote 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 12:49.


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