[ZP] zclass:Hunter -Problem with Jump sound - not hear

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
truex_88
Foreigner
Foreigner
Мнения: 27
Регистриран: 18 мар 2019, 18:33
Се отблагодари: 8 пъти

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от truex_88 » 31 мар 2019, 17:06

Hello. I would have a problem.
If I use the hunter's special ability, a sound will be played. The sound is currently going from where I used the ability. not where the zombie is. so if the zombie jumped, the sound wouldn't go with it.
I'd like to solve, the sound of playing through the zombie model. (From the beginning to the end)



thank you in advance for the answer.



SMA:

Код: Избери всички

/*
*	---------------------------------------------------------------------------------------------------------
*	------------------------------------[ZP] Zombie Class: Hunter--------------------------------------------
*	---------------------------------------------------------------------------------------------------------
*	--------------------------------Author: SNAKER_BEATTER + ORIGINALLY BY DJHD!-----------------------------
*	---------------------------------------------------------------------------------------------------------
*				About:
*		Well this is not by me, this is originally by DJHD!.
*		When i tested hes original hunter if you're a human you can do super jump and if nemesis and 
*		survivor too and thats is i  fixed at this plugin...
*	---------------------------------------------------------------------------------------------------------
*				Description:
*		This zombie has long jumps as well as the popular game L4D2
*		Well, this time the skill is good and better,
*		to jump you have to press Ctrl + E and look where you want to jump...
*	---------------------------------------------------------------------------------------------------------
*				Credits:
*		DJHD! - Originally post by him
*	---------------------------------------------------------------------------------------------------------
*				Cvars:
*		zp_hunter_jump_cooldown // After used cooldown starts. default=1.0 or 1
*		zp_hunter_jump_force // How high hunter's jump do?. default=890 (higher than nemesis's leap)
*		zp_zclass_hunterl4d2 // Show hunter's version and author at console
*	----------------------------------------------------------------------------------------------------------
*				Modules:
*		fakemeta
*	-----------------------------------------------------------------------------------------------------------
*				Change log:
*		0.2a (Oct 1, 2011)
*		{
*			0.2 originally posted by DJHD!
*			Fix hunter is not zombie he can do super jump
*		}
*		0.2b (Oct 5, 2011)
*		{
*			Fix run time errors
&			Fix another zombie class(not hunter) can do super jump
*			FIx after infected do super jump auto
*		}
*/

/******************************************************
		[Include files]
******************************************************/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/******************************************************
		[Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2b"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
		[Id(s)]
******************************************************/

// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "You can do super jumps"
new const zclass_model[] = { "hunterv2_zp" }
new const zclass_clawmodel[] = { "v_knife_zombie_hunter.mdl" }
const zclass_speed = 290
const zclass_health = 710
const Float:zclass_gravity = 0.6
const Float:zclass_knockback = 1.2
// Sounds
new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }
// Variables
new g_hunter, bool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_force, cvar_cooldown

/******************************************************
		[Main events] + [Precache event]
******************************************************/

public plugin_precache()
{
	// Register the new class and store ID for reference
	g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
	// Sound
	static i
	for(i = 0; i < sizeof leap_sound; i++)
		precache_sound(leap_sound[i])
}

public plugin_init() 
{
	// Plugin Info
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	
	// Forward
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") 
	
	// Cvars
	cvar_force = register_cvar("zp_hunter_jump_force", "890") 
	cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "1.0")
	
	static szCvar[30]
	formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
		[Events]
******************************************************/

public zp_user_infected_post(id, infector) // Infected post
{
	// It's the selected zombie class
	if(zp_get_user_zombie_class(id) == g_hunter)
	{
		if(zp_get_user_nemesis(id))
			return
		
		// Message
		client_print(id, print_chat, "HUNTER SKILL: ^"CTRL + E^"")
	}
}

public fw_PlayerPreThink(id) // Main hunter command
{
	if(!zp_get_user_zombie(id))
	{
		false_g_b_is_Jumper(id)
		return 
	}
	
	if(!is_user_alive(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_survivor(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_nemesis(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if(is_user_connected(id))
	{
	
		if (zp_get_user_zombie(id))
		{
			if (zp_get_user_zombie_class(id) == g_hunter)
			{
				if (allowed_hunterjump(id))
				{
					static Float:velocity[3]
					velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
					set_pev(id, pev_velocity, velocity)
				
					g_b_isJumper[id] = true
					emit_sound(id, CHAN_STREAM, leap_sound[random_num(1, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
			
					// Set the current super jump time
					g_lastleaptime[id] = get_gametime()
				}
			}
		}
	}
}

allowed_hunterjump(id) // Main function
{    
	if (g_b_isJumper[id])
	{		
		if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static buttons
		buttons = pev(id, pev_button)
		
		// Not doing a longjump (added bot support)
		if (!(buttons & IN_USE) && !is_user_bot(id))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static Float:cooldown
		cooldown = get_pcvar_float(cvar_cooldown)
		
		if (get_gametime() - g_lastleaptime[id] < cooldown)
			return false
	}
	return true
}


public false_g_b_is_Jumper(id) // Remove super jumps to  human/survivor/nemesis
{
	g_b_isJumper[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Последна промяна от hackera457 СОТА на 31 мар 2019, 21:19, променено общо 1 път.
Причина: Fixed title! Be careful next time!

Потребителски аватар

hackera457 СОТА
Модератор
Модератор
Мнения: 623
Регистриран: 01 ное 2016, 09:46
Местоположение: София
Получена благодарност: 60 пъти
Години: 24
Контакти:

[ZP] zclass:Hunter - Sound Fix

Мнение от hackera457 СОТА » 31 мар 2019, 21:18

Try now

Код: Избери всички

/*
*	---------------------------------------------------------------------------------------------------------
*	------------------------------------[ZP] Zombie Class: Hunter--------------------------------------------
*	---------------------------------------------------------------------------------------------------------
*	--------------------------------Author: SNAKER_BEATTER + ORIGINALLY BY DJHD!-----------------------------
*	---------------------------------------------------------------------------------------------------------
*				About:
*		Well this is not by me, this is originally by DJHD!.
*		When i tested hes original hunter if you're a human you can do super jump and if nemesis and 
*		survivor too and thats is i  fixed at this plugin...
*	---------------------------------------------------------------------------------------------------------
*				Description:
*		This zombie has long jumps as well as the popular game L4D2
*		Well, this time the skill is good and better,
*		to jump you have to press Ctrl + E and look where you want to jump...
*	---------------------------------------------------------------------------------------------------------
*				Credits:
*		DJHD! - Originally post by him
*	---------------------------------------------------------------------------------------------------------
*				Cvars:
*		zp_hunter_jump_cooldown // After used cooldown starts. default=1.0 or 1
*		zp_hunter_jump_force // How high hunter's jump do?. default=890 (higher than nemesis's leap)
*		zp_zclass_hunterl4d2 // Show hunter's version and author at console
*	----------------------------------------------------------------------------------------------------------
*				Modules:
*		fakemeta
*	-----------------------------------------------------------------------------------------------------------
*				Change log:
*		0.2a (Oct 1, 2011)
*		{
*			0.2 originally posted by DJHD!
*			Fix hunter is not zombie he can do super jump
*		}
*		0.2b (Oct 5, 2011)
*		{
*			Fix run time errors
&			Fix another zombie class(not hunter) can do super jump
*			FIx after infected do super jump auto
*		}
*/

/******************************************************
		[Include files]
******************************************************/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/******************************************************
		[Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2b"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
		[Id(s)]
******************************************************/

// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "You can do super jumps"
new const zclass_model[] = { "hunterv2_zp" }
new const zclass_clawmodel[] = { "v_knife_zombie_hunter.mdl" }
const zclass_speed = 290
const zclass_health = 710
const Float:zclass_gravity = 0.6
const Float:zclass_knockback = 1.2
// Sounds
new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }
// Variables
new g_hunter, bool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_force, cvar_cooldown

/******************************************************
		[Main events] + [Precache event]
******************************************************/

public plugin_precache()
{
	// Register the new class and store ID for reference
	g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
	// Sound
	static i
	for(i = 0; i < sizeof leap_sound; i++)
		precache_sound(leap_sound[i])
}

public plugin_init() 
{
	// Plugin Info
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	
	// Forward
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") 
	
	// Cvars
	cvar_force = register_cvar("zp_hunter_jump_force", "890") 
	cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "1.0")
	
	static szCvar[30]
	formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
		[Events]
******************************************************/

public zp_user_infected_post(id, infector) // Infected post
{
	// It's the selected zombie class
	if(zp_get_user_zombie_class(id) == g_hunter)
	{
		if(zp_get_user_nemesis(id))
			return
		
		// Message
		client_print(id, print_chat, "HUNTER SKILL: ^"CTRL + E^"")
	}
}

public fw_PlayerPreThink(id) // Main hunter command
{
	if(!zp_get_user_zombie(id))
	{
		false_g_b_is_Jumper(id)
		return 
	}
	
	if(!is_user_alive(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_survivor(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_nemesis(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if(is_user_connected(id))
	{
	
		if (zp_get_user_zombie(id))
		{
			if (zp_get_user_zombie_class(id) == g_hunter)
			{
				if (allowed_hunterjump(id))
				{
					static Float:velocity[3]
					velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
					set_pev(id, pev_velocity, velocity)
				
					g_b_isJumper[id] = true
					emit_sound(id, CHAN_AUTO, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
			
					// Set the current super jump time
					g_lastleaptime[id] = get_gametime()
				}
			}
		}
	}
}

allowed_hunterjump(id) // Main function
{    
	if (g_b_isJumper[id])
	{		
		if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static buttons
		buttons = pev(id, pev_button)
		
		// Not doing a longjump (added bot support)
		if (!(buttons & IN_USE) && !is_user_bot(id))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static Float:cooldown
		cooldown = get_pcvar_float(cvar_cooldown)
		
		if (get_gametime() - g_lastleaptime[id] < cooldown)
			return false
	}
	return true
}


public false_g_b_is_Jumper(id) // Remove super jumps to  human/survivor/nemesis
{
	g_b_isJumper[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Моите плъгини

Код: Избери всички

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Потребителски аватар

Автор на темата
truex_88
Foreigner
Foreigner
Мнения: 27
Регистриран: 18 мар 2019, 18:33
Се отблагодари: 8 пъти

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от truex_88 » 31 мар 2019, 23:24

hunter_2_test.sma(2) : error 010: invalid function or declaration

1 Error.
Compile failed!

Потребителски аватар

hackera457 СОТА
Модератор
Модератор
Мнения: 623
Регистриран: 01 ное 2016, 09:46
Местоположение: София
Получена благодарност: 60 пъти
Години: 24
Контакти:

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от hackera457 СОТА » 01 апр 2019, 00:04

Код: Избери всички

/*
*	---------------------------------------------------------------------------------------------------------
*	------------------------------------[ZP] Zombie Class: Hunter--------------------------------------------
*	---------------------------------------------------------------------------------------------------------
*	--------------------------------Author: SNAKER_BEATTER + ORIGINALLY BY DJHD!-----------------------------
*	---------------------------------------------------------------------------------------------------------
*				About:
*		Well this is not by me, this is originally by DJHD!.
*		When i tested hes original hunter if you're a human you can do super jump and if nemesis and 
*		survivor too and thats is i  fixed at this plugin...
*	---------------------------------------------------------------------------------------------------------
*				Description:
*		This zombie has long jumps as well as the popular game L4D2
*		Well, this time the skill is good and better,
*		to jump you have to press Ctrl + E and look where you want to jump...
*	---------------------------------------------------------------------------------------------------------
*				Credits:
*		DJHD! - Originally post by him
*	---------------------------------------------------------------------------------------------------------
*				Cvars:
*		zp_hunter_jump_cooldown // After used cooldown starts. default=1.0 or 1
*		zp_hunter_jump_force // How high hunter's jump do?. default=890 (higher than nemesis's leap)
*		zp_zclass_hunterl4d2 // Show hunter's version and author at console
*	----------------------------------------------------------------------------------------------------------
*				Modules:
*		fakemeta
*	-----------------------------------------------------------------------------------------------------------
*				Change log:
*		0.2a (Oct 1, 2011)
*		{
*			0.2 originally posted by DJHD!
*			Fix hunter is not zombie he can do super jump
*		}
*		0.2b (Oct 5, 2011)
*		{
*			Fix run time errors
&			Fix another zombie class(not hunter) can do super jump
*			FIx after infected do super jump auto
*		}
*/

/******************************************************
		[Include files]
******************************************************/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/******************************************************
		[Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2b"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
		[Id(s)]
******************************************************/

// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "You can do super jumps"
new const zclass_model[] = { "hunterv2_zp" }
new const zclass_clawmodel[] = { "v_knife_zombie_hunter.mdl" }
const zclass_speed = 290
const zclass_health = 710
const Float:zclass_gravity = 0.6
const Float:zclass_knockback = 1.2
// Sounds
new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }
// Variables
new g_hunter, bool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_force, cvar_cooldown

/******************************************************
		[Main events] + [Precache event]
******************************************************/

public plugin_precache()
{
	// Register the new class and store ID for reference
	g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
	// Sound
	static i
	for(i = 0; i < sizeof leap_sound; i++)
		precache_sound(leap_sound[i])
}

public plugin_init() 
{
	// Plugin Info
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	
	// Forward
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") 
	
	// Cvars
	cvar_force = register_cvar("zp_hunter_jump_force", "890") 
	cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "1.0")
	
	static szCvar[30]
	formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
		[Events]
******************************************************/

public zp_user_infected_post(id, infector) // Infected post
{
	// It's the selected zombie class
	if(zp_get_user_zombie_class(id) == g_hunter)
	{
		if(zp_get_user_nemesis(id))
			return
		
		// Message
		client_print(id, print_chat, "HUNTER SKILL: ^"CTRL + E^"")
	}
}

public fw_PlayerPreThink(id) // Main hunter command
{
	if(!zp_get_user_zombie(id))
	{
		false_g_b_is_Jumper(id)
		return 
	}
	
	if(!is_user_alive(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_survivor(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_nemesis(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if(is_user_connected(id))
	{
	
		if (zp_get_user_zombie(id))
		{
			if (zp_get_user_zombie_class(id) == g_hunter)
			{
				if (allowed_hunterjump(id))
				{
					static Float:velocity[3]
					velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
					set_pev(id, pev_velocity, velocity)
				
					g_b_isJumper[id] = true
					//emit_sound(id, CHAN_AUTO, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
					client_cmd(id,"spk ^"%s^"", leap_sound[random_num(0, sizeof leap_sound -1)])
			
					// Set the current super jump time
					g_lastleaptime[id] = get_gametime()
				}
			}
		}
	}
}

allowed_hunterjump(id) // Main function
{    
	if (g_b_isJumper[id])
	{		
		if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static buttons
		buttons = pev(id, pev_button)
		
		// Not doing a longjump (added bot support)
		if (!(buttons & IN_USE) && !is_user_bot(id))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static Float:cooldown
		cooldown = get_pcvar_float(cvar_cooldown)
		
		if (get_gametime() - g_lastleaptime[id] < cooldown)
			return false
	}
	return true
}


public false_g_b_is_Jumper(id) // Remove super jumps to  human/survivor/nemesis
{
	g_b_isJumper[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Моите плъгини

Код: Избери всички

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Потребителски аватар

Автор на темата
truex_88
Foreigner
Foreigner
Мнения: 27
Регистриран: 18 мар 2019, 18:33
Се отблагодари: 8 пъти

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от truex_88 » 01 апр 2019, 00:24

not good. can't hear everyone, just the zombie. I want people to hear it.

Потребителски аватар

hackera457 СОТА
Модератор
Модератор
Мнения: 623
Регистриран: 01 ное 2016, 09:46
Местоположение: София
Получена благодарност: 60 пъти
Години: 24
Контакти:

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от hackera457 СОТА » 01 апр 2019, 00:29

Код: Избери всички

/*
*	---------------------------------------------------------------------------------------------------------
*	------------------------------------[ZP] Zombie Class: Hunter--------------------------------------------
*	---------------------------------------------------------------------------------------------------------
*	--------------------------------Author: SNAKER_BEATTER + ORIGINALLY BY DJHD!-----------------------------
*	---------------------------------------------------------------------------------------------------------
*				About:
*		Well this is not by me, this is originally by DJHD!.
*		When i tested hes original hunter if you're a human you can do super jump and if nemesis and 
*		survivor too and thats is i  fixed at this plugin...
*	---------------------------------------------------------------------------------------------------------
*				Description:
*		This zombie has long jumps as well as the popular game L4D2
*		Well, this time the skill is good and better,
*		to jump you have to press Ctrl + E and look where you want to jump...
*	---------------------------------------------------------------------------------------------------------
*				Credits:
*		DJHD! - Originally post by him
*	---------------------------------------------------------------------------------------------------------
*				Cvars:
*		zp_hunter_jump_cooldown // After used cooldown starts. default=1.0 or 1
*		zp_hunter_jump_force // How high hunter's jump do?. default=890 (higher than nemesis's leap)
*		zp_zclass_hunterl4d2 // Show hunter's version and author at console
*	----------------------------------------------------------------------------------------------------------
*				Modules:
*		fakemeta
*	-----------------------------------------------------------------------------------------------------------
*				Change log:
*		0.2a (Oct 1, 2011)
*		{
*			0.2 originally posted by DJHD!
*			Fix hunter is not zombie he can do super jump
*		}
*		0.2b (Oct 5, 2011)
*		{
*			Fix run time errors
&			Fix another zombie class(not hunter) can do super jump
*			FIx after infected do super jump auto
*		}
*/

/******************************************************
		[Include files]
******************************************************/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/******************************************************
		[Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2b"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
		[Id(s)]
******************************************************/

// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "You can do super jumps"
new const zclass_model[] = { "hunterv2_zp" }
new const zclass_clawmodel[] = { "v_knife_zombie_hunter.mdl" }
const zclass_speed = 290
const zclass_health = 710
const Float:zclass_gravity = 0.6
const Float:zclass_knockback = 1.2
// Sounds
new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav", "left_4_dead2/hunter_jump1.wav", "left_4_dead2/hunter_jump2.wav", "left_4_dead2/hunter_jump3.wav" }
// Variables
new g_hunter, bool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_force, cvar_cooldown

/******************************************************
		[Main events] + [Precache event]
******************************************************/

public plugin_precache()
{
	// Register the new class and store ID for reference
	g_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
	// Sound
	static i
	for(i = 0; i < sizeof leap_sound; i++)
		precache_sound(leap_sound[i])
}

public plugin_init() 
{
	// Plugin Info
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	
	// Forward
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") 
	
	// Cvars
	cvar_force = register_cvar("zp_hunter_jump_force", "890") 
	cvar_cooldown = register_cvar("zp_hunter_jump_cooldown", "1.0")
	
	static szCvar[30]
	formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_cvar("zp_zclass_hunterl4d2", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
		[Events]
******************************************************/

public zp_user_infected_post(id, infector) // Infected post
{
	// It's the selected zombie class
	if(zp_get_user_zombie_class(id) == g_hunter)
	{
		if(zp_get_user_nemesis(id))
			return
		
		// Message
		client_print(id, print_chat, "HUNTER SKILL: ^"CTRL + E^"")
	}
}

public fw_PlayerPreThink(id) // Main hunter command
{
	if(!zp_get_user_zombie(id))
	{
		false_g_b_is_Jumper(id)
		return 
	}
	
	if(!is_user_alive(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_survivor(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if (zp_get_user_nemesis(id))
	{
		false_g_b_is_Jumper(id)
		return
	}
	
	if(is_user_connected(id))
	{
	
		if (zp_get_user_zombie(id))
		{
			if (zp_get_user_zombie_class(id) == g_hunter)
			{
				if (allowed_hunterjump(id))
				{
					static Float:velocity[3]
					velocity_by_aim(id, get_pcvar_num(cvar_force), velocity)
					set_pev(id, pev_velocity, velocity)
				
					g_b_isJumper[id] = true
					//emit_sound(id, CHAN_AUTO, leap_sound[random_num(0, sizeof leap_sound -1)], 1.0, ATTN_NORM, 0, PITCH_HIGH)
					client_cmd(0,"spk ^"%s^"", leap_sound[random_num(0, sizeof leap_sound -1)])
			
					// Set the current super jump time
					g_lastleaptime[id] = get_gametime()
				}
			}
		}
	}
}

allowed_hunterjump(id) // Main function
{    
	if (g_b_isJumper[id])
	{		
		if (!((pev(id, pev_flags) & FL_ONGROUND) && (pev(id, pev_flags) & FL_DUCKING)))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static buttons
		buttons = pev(id, pev_button)
		
		// Not doing a longjump (added bot support)
		if (!(buttons & IN_USE) && !is_user_bot(id))
		{
			g_b_isJumper[id] = true
			return false
		}
		
		static Float:cooldown
		cooldown = get_pcvar_float(cvar_cooldown)
		
		if (get_gametime() - g_lastleaptime[id] < cooldown)
			return false
	}
	return true
}


public false_g_b_is_Jumper(id) // Remove super jumps to  human/survivor/nemesis
{
	g_b_isJumper[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Моите плъгини

Код: Избери всички

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Потребителски аватар

Автор на темата
truex_88
Foreigner
Foreigner
Мнения: 27
Регистриран: 18 мар 2019, 18:33
Се отблагодари: 8 пъти

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от truex_88 » 01 апр 2019, 00:40

hunter_v2.sma(2) : error 010: invalid function or declaration

1 Error.
Compile failed!

Потребителски аватар

Автор на темата
truex_88
Foreigner
Foreigner
Мнения: 27
Регистриран: 18 мар 2019, 18:33
Се отблагодари: 8 пъти

[ZP] zclass:Hunter -Problem with Jump sound - not hear

Мнение от truex_88 » 01 апр 2019, 08:18

sorry for the wrong wording. I did not think that way. Now everyone can hear the sound.no matter how far from the zombie you are.I want the sound of the zombie to come out. realistically. there is the sound where the zombie model itself is.


the sound has been played earlier as well, the problem just with the position.

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 1 гост