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

Help / Support [HELP] Zombie use skill button doesnt work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 06-25-2012 , 09:06   [HELP] Zombie use skill button doesnt work
Reply With Quote #1

Hi, i have got problems with use skill button in rage and siren zombies. Sometimes in_reload button works but sometimes doesnt work

Siren
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <xs>
#include <hamsandwich>
#include <zombieplague>

/*================================================================================
 [Customizations]
=================================================================================*/

// Zombie Attributes
new const zclass_name[] = "Siren" // name
new const zclass_info[] = "\y=Oriloh=" // description
new const zclass_model[] = "xopom_siren" // model
new const zclass_clawmodel[] = "v_knife_xopom.mdl" // claw model
new const zclass_screamsounds[][] = { "killing_floor/siren_scream.wav" } // scream sound

const zclass_health = 3300 // health
const zclass_speed = 240 // speed

const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback

/*================================================================================
 Customization ends here! Yes, that's it. Editing anything beyond
 here is not officially supported. Proceed at your own risk...
=================================================================================*/

// Variables
new g_iSirenZID, g_iMaxPlayers, g_msgSayText, g_msgScreenFade, g_msgScreenShake,
g_msgBarTime

// Arrays
new g_iPlayerTaskTimes[33]

// Cvar pointers
new cvar_screammode, cvar_duration, cvar_screamdmg, cvar_startime, cvar_reloadtime,
cvar_radius, cvar_damagemode, cvar_slowdown

// Cached cvars
new g_iCvar_ScreamMode, g_iCvar_ScreamDuration, g_iCvar_ScreamDmg, 
g_iCvar_ScreamStartTime, Float:g_flCvar_ReloadTime, Float:g_flCvar_Radius,
g_iCvar_DamageMode, Float:g_flCvar_ScreamSlowdown

// Bools
new bool:g_bIsConnected[33], bool:g_bIsAlive[33], bool:g_bInScreamProcess[33], 
bool:g_bCanDoScreams[33], bool:g_bKilledByScream[33], bool:g_bDoingScream[33], 
bool:g_bRoundEnding

// Some constants
const FFADE_IN = 		0x0000
const GIB_NEVER =		0
const UNIT_SECOND = 		(1<<12)
const TASK_SCREAM =		37729
const TASK_RELOAD =		55598
const TASK_SCREAMDMG =		48289
const NADE_TYPE_INFECTION = 	1111

// Plug info.
#define PLUG_VERSION "0.2"
#define PLUG_AUTH "meTaLiCroSS"

// Macros
#define zp_get_grenade_type(%1)		(entity_get_int(%1, EV_INT_flTimeStepSound))
#define is_user_valid_alive(%1) 	(1 <= %1 <= g_iMaxPlayers && g_bIsAlive[%1])
#define is_user_valid_connected(%1) 	(1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])

/*================================================================================
 [Init, CFG and Precache]
=================================================================================*/

public plugin_init()
{
	// Plugin Info
	register_plugin("[XopoM] ZClass: Siren", PLUG_VERSION, PLUG_AUTH)
		
	// Main events
	register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
	
	// Main messages
	register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
	
	// Fakemeta Forwards
	register_forward(FM_CmdStart, "fw_CmdStart")
	
	// Hamsandwich Forward
	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
	
	// Cvars
	cvar_screammode = register_cvar("zp_siren_mode", "0")
	cvar_duration = register_cvar("zp_siren_scream_duration", "3")
	cvar_screamdmg = register_cvar("zp_siren_scream_damage", "2")
	cvar_startime = register_cvar("zp_siren_scream_start_time", "1")
	cvar_reloadtime = register_cvar("zp_siren_scream_reload_time", "20.0")
	cvar_radius = register_cvar("zp_siren_scream_radius", "250.0")
	cvar_damagemode = register_cvar("zp_siren_damage_mode", "0")
	cvar_slowdown = register_cvar("zp_siren_damage_slowdown", "0.5")
	
	static szCvar[30]
	formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTH)
	register_cvar("zp_zclass_siren", szCvar, FCVAR_SERVER|FCVAR_SPONLY) 
	
	// Vars
	g_iMaxPlayers = get_maxplayers()
	g_msgBarTime = get_user_msgid("BarTime")
	g_msgSayText = get_user_msgid("SayText")
	g_msgScreenFade = get_user_msgid("ScreenFade")
	g_msgScreenShake = get_user_msgid("ScreenShake")
}

public plugin_cfg()
{
	// Cache some cvars
	cache_cvars()
}

public plugin_precache()
{
	// Register the new class and store ID for reference
	g_iSirenZID = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)	

	// Sounds
	static i
	for(i = 0; i < sizeof zclass_screamsounds; i++)
		precache_sound(zclass_screamsounds[i])
}

/*================================================================================
 [Main Events/Messages]
=================================================================================*/

public event_RoundStart()
{
	// Caching cvars
	cache_cvars()
	
	// Reset round end bar
	g_bRoundEnding = false
}

public message_DeathMsg(msg_id, msg_dest, id)
{
	static iAttacker, iVictim
	
	// Get attacker and victim
	iAttacker = get_msg_arg_int(1)
	iVictim = get_msg_arg_int(2)
	
	// Non-player attacker or self kill
	if(!is_user_connected(iAttacker) || iAttacker == iVictim)
		return PLUGIN_CONTINUE
		
	// Killed by siren scream
	if(g_bKilledByScream[iVictim])
		set_msg_arg_string(4, "siren scream")
		
	return PLUGIN_CONTINUE
}

/*================================================================================
 [Main Forwards]
=================================================================================*/

public client_putinserver(id)
{
	// Updating bool
	g_bIsConnected[id] = true
}

public client_disconnect(id)
{
	// Updating bool
	g_bIsAlive[id] = false
	g_bIsConnected[id] = false
}

public fw_PlayerSpawn_Post(id)
{
	// Not alive...
	if(!is_user_alive(id))
		return HAM_IGNORED
		
	// Player is alive
	g_bIsAlive[id] = true
	
	// Reset player vars and tasks
	stop_scream_task(id)
	
	g_bCanDoScreams[id] = false
	g_bDoingScream[id] = false
	g_iPlayerTaskTimes[id] = 0
	
	remove_task(id+TASK_RELOAD)
	remove_task(id+TASK_SCREAMDMG)
	
	return HAM_IGNORED
}

public fw_PlayerKilled(victim, attacker, shouldgib)
{
	// Player victim
	if(is_user_valid_connected(victim))
	{
		// Victim is not alive
		g_bIsAlive[victim] = false
		
		// Reset player vars and tasks
		stop_scream_task(victim)
		
		g_bCanDoScreams[victim] = false
		g_bDoingScream[victim] = false
		g_iPlayerTaskTimes[victim] = 0
		
		remove_task(victim+TASK_RELOAD)
		remove_task(victim+TASK_SCREAMDMG)
		
		return HAM_HANDLED
	}
	
	return HAM_IGNORED
}

public fw_CmdStart(id, handle, random_seed)
{
	// Not alive
	if(!is_user_alive(id))
		return FMRES_IGNORED;
	
	// Isn't a zombie?
	if(!zp_get_user_zombie(id) || zp_get_user_nemesis(id))
		return FMRES_IGNORED;
		
	// Invalid class id
	if(zp_get_user_zombie_class(id) != g_iSirenZID)
		return FMRES_IGNORED;
		
	// Get user old and actual buttons
	static iInUseButton, iInUseOldButton
	iInUseButton = (get_uc(handle, UC_Buttons) & IN_RELOAD)
	iInUseOldButton = (get_user_oldbutton(id) & IN_RELOAD)
	
	// Pressing +use button
	if(iInUseButton)
	{
		// Last used button isn't +use, i need to
		// do this, because i call this "only" 1 time
		if(!iInUseOldButton && g_bCanDoScreams[id] && !g_bDoingScream[id] && !g_bRoundEnding)
		{
			// A bar appears in his screen
			message_begin(MSG_ONE, g_msgBarTime, _, id)
			write_byte(g_iCvar_ScreamStartTime) // time
			write_byte(0) // unknown
			message_end()
			
			// Update bool
			g_bInScreamProcess[id] = true
			
			// Next scream time
			set_task(g_iCvar_ScreamStartTime + 0.2, "task_do_scream", id+TASK_SCREAM)
			
			return FMRES_HANDLED
		}
	}
	else
	{
		// Last used button it's +use
		if(iInUseOldButton && g_bInScreamProcess[id])
		{
			// Stop scream main task
			stop_scream_task(id)
			
			return FMRES_HANDLED
		}
	}
	
	return FMRES_IGNORED
}

/*================================================================================
 [Tasks]
=================================================================================*/

public task_do_scream(id)
{
	// Normalize task
	id -= TASK_SCREAM
	
	// Do scream sound
	emit_sound(id, CHAN_STREAM, zclass_screamsounds[random_num(0, sizeof zclass_screamsounds - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	// Block screams
	g_bCanDoScreams[id] = false
	
	// Reload task
	set_task(g_flCvar_ReloadTime, "task_reload_scream", id+TASK_RELOAD)
	
	// Now it's doing an scream
	g_bDoingScream[id] = true
	
	// Get his origin coords
	static iOrigin[3]
	get_user_origin(id, iOrigin)
	
	// Do a good effect, life the original Killing Floor.
	message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin) 
	write_byte(TE_LAVASPLASH)
	write_coord(iOrigin[0]) 
	write_coord(iOrigin[1]) 
	write_coord(iOrigin[2]) 
	message_end()
	
	// Scream damage task
	set_task(0.1, "task_scream_process", id+TASK_SCREAMDMG, _, _, "b")
}

public task_reload_scream(id)
{
	// Normalize taks
	id -= TASK_RELOAD
	
	// Can do screams again
	g_bCanDoScreams[id] = true
	
	// Message
	client_printcolor(id, "/g[XopoM]/y Ta /gR/y useg ashiglan oriloh bolomjtoi")
}

public task_scream_process(id)
{
	// Normalize task
	id -= TASK_SCREAMDMG
	
	// Time exceed
	if(g_iPlayerTaskTimes[id] >= (g_iCvar_ScreamDuration*10) || g_bRoundEnding)
	{
		// Remove player task
		remove_task(id+TASK_SCREAMDMG)
		
		// Reset task times count
		g_iPlayerTaskTimes[id] = 0
		
		// Update bool
		g_bDoingScream[id] = false
		
		return;
	}
	
	// Update player task time
	g_iPlayerTaskTimes[id]++
	
	// Get player origin
	static Float:flOrigin[3]
	entity_get_vector(id, EV_VEC_origin, flOrigin)
	
	// Collisions
	static iVictim
	iVictim = -1
	
	// Vector var
	static Float:flVictimOrigin[3]
	
	// Screen effects for him self
	screen_effects(id)
	
	// Do scream effects
	while((iVictim = find_ent_in_sphere(iVictim, flOrigin, g_flCvar_Radius)) != 0)
	{
		// Non-player entity
		if(!is_user_valid_connected(iVictim))
		{
			// Validation check
			if(is_valid_ent(iVictim))
			{
				// Get entity classname
				static szClassname[33]
				entity_get_string(iVictim, EV_SZ_classname, szClassname, charsmax(szClassname))
				
				// It's a grenade, and isn't an Infection Bomb
				if(equal(szClassname, "grenade") && zp_get_grenade_type(iVictim) != NADE_TYPE_INFECTION)
				{
					// Get grenade origin
					entity_get_vector(iVictim, EV_VEC_origin, flVictimOrigin)
					
					// Do a good effect
					engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flVictimOrigin, 0)
					write_byte(TE_PARTICLEBURST) // TE id
					engfunc(EngFunc_WriteCoord, flVictimOrigin[0]) // x
					engfunc(EngFunc_WriteCoord, flVictimOrigin[1]) // y
					engfunc(EngFunc_WriteCoord, flVictimOrigin[2]) // z
					write_short(45) // radius
					write_byte(108) // particle color
					write_byte(10) // duration * 10 will be randomized a bit
					message_end()
					
					// Remove it
					remove_entity(iVictim)
				}
				// If i don't check his solid type, it's used all the time.
				else if(equal(szClassname, "func_breakable") && entity_get_int(iVictim, EV_INT_solid) != SOLID_NOT)
				{
					// Destroy entity if he can
					force_use(id, iVictim)
				}
			}
			
			continue;
		}
			
		// Not alive, zombie or with Godmode
		if(!g_bIsAlive[iVictim] || zp_get_user_zombie(iVictim) || get_user_godmode(iVictim))
			continue;
			
		// Screen effects for victims
		screen_effects(iVictim)
			
		// Get scream mode
		switch(g_iCvar_ScreamMode)
		{
			// Do damage
			case 0:
			{
				// Scream slowdown, first should be enabled
				if(g_flCvar_ScreamSlowdown > 0.0)
				{
					// Get his current velocity vector
					static Float:flVelocity[3]
					get_user_velocity(iVictim, flVelocity)
					
					// Multiply his velocity by a number
					xs_vec_mul_scalar(flVelocity, g_flCvar_ScreamSlowdown, flVelocity)
					
					// Set his new velocity vector
					set_user_velocity(iVictim, flVelocity)	
				}
				
				// Get damage result
				static iNewHealth
				iNewHealth = max(0, get_user_health(iVictim) - g_iCvar_ScreamDmg)
				
				// Does not has health
				if(!iNewHealth)
				{
					// Be infected when it's going to die
					if(g_iCvar_DamageMode /* == 1*/)
					{
						// Returns 1 on sucess...
						if(zp_infect_user(iVictim, id, 0, 1))
							continue
					}
	
					// Kill it
					scream_kill(iVictim, id)
					
					continue
				}
				
				// Do fake damage
				set_user_health(iVictim, iNewHealth)
			}
			
			// Instantly Infect
			case 1:
			{
				// Can be infected?
				if(!zp_infect_user(iVictim, id, 0, 1))
				{
					// Kill it
					scream_kill(iVictim, id)
				}
			}
			
			// Instantly Kill
			case 2:
			{
				// Kill it
				scream_kill(iVictim, id)
			}
		}
			
	}
}

/*================================================================================
 [Zombie Plague Forwards]
=================================================================================*/

public zp_user_infected_post(id, infector)
{
	// It's the selected zombie class
	if(zp_get_user_zombie_class(id) == g_iSirenZID && !zp_get_user_nemesis(id))
	{
		// Array
		g_bCanDoScreams[id] = true
		
		// Message
		client_printcolor(id, "/g[XopoM]/y Ta /gR/y useg ashiglan /goriloh/y bolomjtoi")
	}
}

public zp_user_humanized_post(id)
{
	// Reset player vars and tasks
	stop_scream_task(id)
	
	g_bCanDoScreams[id] = false
	g_bDoingScream[id] = false
	g_iPlayerTaskTimes[id] = 0
	
	remove_task(id+TASK_RELOAD)
	remove_task(id+TASK_SCREAMDMG)
}

public zp_round_ended(winteam)
{
	// Update bool
	g_bRoundEnding = true
	
	// Make a loop
	static id
	for(id = 1; id <= g_iMaxPlayers; id++)
	{
		// Valid connected
		if(is_user_valid_connected(id))
		{
			// Remove mainly tasks
			stop_scream_task(id)
			remove_task(id+TASK_RELOAD)
		}
	}
}

/*================================================================================
 [Internal Functions]
=================================================================================*/

stop_scream_task(id)
{
	// Remove the task
	if(task_exists(id+TASK_SCREAM)) 
	{
		remove_task(id+TASK_SCREAM)
	
		// Remove screen's bar
		message_begin(MSG_ONE, g_msgBarTime, _, id)
		write_byte(0) // time
		write_byte(0) // unknown
		message_end()
		
		// Update bool
		g_bInScreamProcess[id] = false
	}
}

screen_effects(id)
{
	// Screen Fade
	message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, id)
	write_short(UNIT_SECOND*1) // duration
	write_short(UNIT_SECOND*1) // hold time
	write_short(FFADE_IN) // fade type
	write_byte(200) // r
	write_byte(0) // g
	write_byte(0) // b
	write_byte(125) // alpha
	message_end()
	
	// Screen Shake
	message_begin(MSG_ONE_UNRELIABLE, g_msgScreenShake, _, id)
	write_short(UNIT_SECOND*5) // amplitude
	write_short(UNIT_SECOND*1) // duration
	write_short(UNIT_SECOND*5) // frequency
	message_end()
}

cache_cvars()
{
	g_iCvar_ScreamMode = get_pcvar_num(cvar_screammode)
	g_iCvar_ScreamDuration = get_pcvar_num(cvar_duration)
	g_iCvar_ScreamDmg = get_pcvar_num(cvar_screamdmg)
	g_iCvar_ScreamStartTime = get_pcvar_num(cvar_startime)
	g_iCvar_DamageMode = get_pcvar_num(cvar_damagemode)
	g_flCvar_ReloadTime = floatmax(g_iCvar_ScreamDuration+0.0, get_pcvar_float(cvar_reloadtime))
	g_flCvar_Radius = get_pcvar_float(cvar_radius)
	g_flCvar_ScreamSlowdown = get_pcvar_float(cvar_slowdown)
}

scream_kill(victim, attacker)
{
	// To use later in DeathMsg event
	g_bKilledByScream[victim] = true
	
	// Do kill
	ExecuteHamB(Ham_Killed, victim, attacker, GIB_NEVER)
	
	// We don't need this
	g_bKilledByScream[victim] = false
}

/*================================================================================
 [Stocks]
=================================================================================*/

stock client_printcolor(id, const input[], any:...)
{
	static iPlayersNum[32], iCount; iCount = 1
	static szMsg[191]
	
	vformat(szMsg, charsmax(szMsg), input, 3)
	
	replace_all(szMsg, 190, "/g", "^4") // green txt
	replace_all(szMsg, 190, "/y", "^1") // orange txt
	replace_all(szMsg, 190, "/ctr", "^3") // team txt
	replace_all(szMsg, 190, "/w", "^0") // team txt
	
	if(id) iPlayersNum[0] = id
	else get_players(iPlayersNum, iCount, "ch")
		
	for (new i = 0; i < iCount; i++)
	{
		if (g_bIsConnected[iPlayersNum[i]])
		{
			message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum[i])
			write_byte(iPlayersNum[i])
			write_string(szMsg)
			message_end()
		}
	}
}
Rage
Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

enum (+=1337)
{
	TASK_AURA
}

#define ID_AURA		(taskid - TASK_AURA)

#define CHAT_PREFIX	"[XopoM]"

new const VERSION[] = "1.3"

new const RAGE_SOUND[] = "zombie_plague/zombie_rage.wav"

new const zclass_name[] = "Rage"
new const zclass_info[] = "\rHurdlah [R]"
new const zclass_model[] = "zombie_rage"
new const zclass_clawmodel[] = "v_knife_rage.mdl"
const zclass_health = 3800
const zclass_speed = 220
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0

const OFFSET_PAINSHOCK = 108
const OFFSET_LINUX = 5

const Float: RENDERING_DELAY = 3.0

new g_zclass_rage

new r, g, b, radius, Float:maxspeed

new cvar_duration, cvar_cooldown, cvar_rgb, cvar_radius, cvar_maxspeed, cvar_rageaddhealth, cvar_ragemultiplier, cvar_painshockfree

new bool:DmgAllowed

new Float:g_hookTime[33]

new g_msgSayText

new g_bitConnectedPlayers, g_bitAlivePlayers, g_bitIsRagePlayers, g_bitInRagePlayers, g_bitOMFGspamPlayers
#define MarkUserConnected(%0)   g_bitConnectedPlayers |= (1 << (%0 & 31))
#define ClearUserConnected(%0)  g_bitConnectedPlayers &= ~(1 << (%0 & 31))
#define IsUserConnected(%0)		g_bitConnectedPlayers & (1 << (%0 & 31))

#define MarkUserAlive(%0)   g_bitAlivePlayers |= (1 << (%0 & 31))
#define ClearUserAlive(%0)  g_bitAlivePlayers &= ~(1 << (%0 & 31))
#define IsUserAlive(%0)		g_bitAlivePlayers & (1 << (%0 & 31))

#define MarkUserIsRage(%0)   g_bitIsRagePlayers |= (1 << (%0 & 31))
#define ClearUserIsRage(%0)  g_bitIsRagePlayers &= ~(1 << (%0 & 31))
#define IsUserIsRage(%0)		g_bitIsRagePlayers & (1 << (%0 & 31))

#define MarkUserInRage(%0)   g_bitInRagePlayers |= (1 << (%0 & 31))
#define ClearUserInRage(%0)  g_bitInRagePlayers &= ~(1 << (%0 & 31))
#define IsUserInRage(%0)		g_bitInRagePlayers & (1 << (%0 & 31))

#define MarkUserOMFGspam(%0)   g_bitOMFGspamPlayers |= (1 << (%0 & 31))
#define ClearUserOMFGspam(%0)  g_bitOMFGspamPlayers &= ~(1 << (%0 & 31))
#define IsUserOMFGspam(%0)		g_bitOMFGspamPlayers & (1 << (%0 & 31))

public plugin_init()
{
	register_plugin("[XopoM] ZClass: Rage", VERSION, "eXcalibur.007")
	
	cvar_duration = register_cvar("zp_rage_duration", "6.0")
	cvar_cooldown = register_cvar("zp_rage_cooldown", "15.0")
	
	// RRR GGG BBB AAA - Red Green Blue Alpha
	cvar_rgb = register_cvar("zp_rage_rgb", "110 250 110 16")
	cvar_radius = register_cvar("zp_rage_radius", "20")
	
	cvar_maxspeed = register_cvar("zp_rage_maxspeed", "900.0")
	cvar_rageaddhealth = register_cvar("zp_rage_addhealth", "100")
	cvar_ragemultiplier = register_cvar("zp_rage_dmgmultiplier", "2.0")
	cvar_painshockfree = register_cvar("zp_rage_painshockfree", "1")
	
	register_forward(FM_CmdStart, "fw_CmdStart")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
	RegisterHam(Ham_TakeDamage, "player", "fw_PlayerTakeDamage")
	RegisterHam(Ham_TakeDamage, "player", "fw_PlayerTakeDamage_Post", 1)
	
	g_msgSayText = get_user_msgid("SayText")
}

public plugin_precache()
{
	g_zclass_rage = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
	
	precache_sound(RAGE_SOUND)
}

public client_putinserver(id)
{
	MarkUserConnected(id)
}

public client_disconnect(id)
{
	ClearUserConnected(id)
	ClearUserAlive(id)
	ClearUserIsRage(id)
	ClearUserInRage(id)
	ClearUserOMFGspam(id)
}

public fw_CmdStart(id, uc_handle, seed)
{
	if (IsUserAlive(id) && IsUserIsRage(id))
	{
		if (IsUserInRage(id) || IsUserOMFGspam(id))
			return FMRES_IGNORED
		
		static buttons; buttons = get_uc(uc_handle, UC_Buttons)
		
		if (buttons & IN_RELOAD)
		{
			static Float: cooldown
			cooldown = get_pcvar_float(cvar_cooldown)
			
			if (get_gametime() - g_hookTime[id] < cooldown)
			{
				MarkUserOMFGspam(id)
				set_task(1.0, "reset_vars", id)
				client_printcolor(id, "[XopoM Rage] Tanii chadvar 18sec unshih bolno!", CHAT_PREFIX, cooldown - (get_gametime() - g_hookTime[id]))
				return FMRES_IGNORED
			}
			
			g_hookTime[id] = get_gametime()
			
			MarkUserInRage(id)
			
			emit_sound(id, CHAN_AUTO, RAGE_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
			
			static color[32], szRed[4], szGreen[4], szBlue[4], szAmount[4]
			get_pcvar_string(cvar_rgb, color, 31)
			parse(color, szRed, 3, szGreen, 3, szBlue, 3, szAmount, 3)
			
			set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_rageaddhealth))
			
			set_task(get_pcvar_float(cvar_duration), "stop_raging", id)
			
			r = clamp(str_to_num(szRed), 0, 255)
			g = clamp(str_to_num(szGreen), 0, 255)
			b = clamp(str_to_num(szBlue), 0, 255)
			radius = get_pcvar_num(cvar_radius)
			maxspeed = get_pcvar_float(cvar_maxspeed)
	
			set_task(0.1, "rage_aura", id+TASK_AURA, _, _, "b")
		}
	}
	
	return FMRES_IGNORED
}

public fw_PlayerPreThink(id)
{
	if (IsUserAlive(id) && IsUserIsRage(id) && IsUserInRage(id))
	{
		set_user_maxspeed(id, maxspeed)
	}
	
	return FMRES_IGNORED
}

public fw_PlayerSpawn_Post(id)
{
	if (is_user_alive(id))
	{
		MarkUserAlive(id)
		ClearUserIsRage(id)
		ClearUserInRage(id)
	}
}

public fw_PlayerKilled_Post(victim)
{
	ClearUserAlive(victim)
	ClearUserIsRage(victim)
	ClearUserInRage(victim)
}

public fw_PlayerTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
	if (DmgAllowed && IsUserAlive(attacker) && IsUserAlive(victim) && IsUserInRage(attacker))
	{
		SetHamParamFloat(4, damage * get_pcvar_float(cvar_ragemultiplier))
	}
	
	return HAM_IGNORED
}

public fw_PlayerTakeDamage_Post(victim, inflictor, attacker)
{
	if (victim != attacker && IsUserIsRage(victim) && IsUserInRage(victim) && IsUserAlive(victim) && get_pcvar_num(cvar_painshockfree))
	{
		set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
	}
	
	return HAM_IGNORED
}

public zp_user_infected_post(id, infector)
{
	if (zp_get_user_zombie_class(id) == g_zclass_rage && !zp_get_user_nemesis(id))
	{
		client_printcolor(id, "[XopoM Rage] Ta R useg darj uurlah bolomjtoi", CHAT_PREFIX)
		
		MarkUserIsRage(id)
		ClearUserInRage(id)
	}
}

public zp_user_humanized_post(id)
{
	ClearUserIsRage(id)
	ClearUserInRage(id)
	
	if (IsUserAlive(id))
	{
		set_user_rendering(id)
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
}

public zp_round_started(gamemode)
{
	if (gamemode == MODE_SWARM || gamemode == MODE_PLAGUE || gamemode == MODE_SURVIVOR)
		DmgAllowed = true
	else
		DmgAllowed = false
}

public stop_raging(id)
{
	if (IsUserAlive(id))
	{
		ClearUserInRage(id)
		
		set_user_rendering(id)
		
		client_printcolor(id, "[XopoM Rage] Tanii uur daragdlaa", CHAT_PREFIX)
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
}

public rage_aura(taskid)
{
	if (IsUserInRage(ID_AURA) && IsUserAlive(ID_AURA))
	{
		static origin[3]
		get_user_origin(ID_AURA, origin)
		
		// I hook the cvars before this task so they wont be called every 0.1 second. That would be awful :(
		message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
		write_byte(TE_DLIGHT)
		write_coord(origin[0])
		write_coord(origin[1])
		write_coord(origin[2])
		write_byte(radius)
		write_byte(r)
		write_byte(g)
		write_byte(b)
		write_byte(2)
		write_byte(0)
		message_end()
	}
	else
	{
		remove_task(taskid)
		return
	}
}

public reset_vars(id)
{
	if (IsUserConnected(id))
		ClearUserOMFGspam(id)
}

stock client_printcolor(const id, const input[ ], any:...)
{
	new count = 1, iPlayers[32]
	
	static szMsg[191]
	vformat(szMsg, charsmax(szMsg), input, 3)
	
	replace_all(szMsg, 190, "!g", "^4") 
	replace_all(szMsg, 190, "!y", "^1") 
	replace_all(szMsg, 190, "!ctr", "^3") 
	// replace_all(szMsg, 190, "!w", "^0") 
	
	if (id)
		iPlayers[0] = id
	else
		get_players(iPlayers, count, "ch")
	
	for (new i = 0; i < count; i++)
	{
		if (IsUserConnected(iPlayers[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
			write_byte(iPlayers[i])
			write_string(szMsg)
			message_end()
		}
	}
}
__________________

Last edited by naSTR; 06-25-2012 at 09:07.
naSTR is offline
cOMpirm
Senior Member
Join Date: Jun 2012
Old 06-27-2012 , 12:20   Re: [HELP] Zombie use skill button doesnt work
Reply With Quote #2

i have that problem too. anyone can help??
cOMpirm is offline
cOMpirm
Senior Member
Join Date: Jun 2012
Old 06-28-2012 , 08:46   Re: [HELP] Zombie use skill button doesnt work
Reply With Quote #3

ehh no one???
cOMpirm 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 10:03.


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