Raised This Month: $ Target: $400
 0% 

What is wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 06-28-2010 , 14:07   What is wrong?
Reply With Quote #1

If zombies has X health it shows blood sprites on his body but it doesnt work..

Code:
/*================================================================================
	
	---------------------------------
	-*- [ZP] Low HP Heartbeat 1.1 -*-
	---------------------------------
	
	~~~~~~~~~~~~~~~
	- Description -
	~~~~~~~~~~~~~~~
	
	This plugin plays a heartbeat sound on humans when their health
	is under certain amount.
	
	~~~~~~~~~
	- CVARS -
	~~~~~~~~~
	
	* zp_heartbeat_hp <50> - Heartbeats start when HP is lower than this
	
	~~~~~~~~~~~~~~
	- Credits to -
	~~~~~~~~~~~~~~
	
	* ConnorMcLeod, AlexBreems: for the original plugin
	
================================================================================*/

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

new cvar_heartbeathp

public plugin_init()
{
	register_plugin("[ZP] Low HP Heartbeat", "1.1", "ConnorMcLeod/MeRcyLeZZ")
	
	register_event("Damage", "event_damage", "be", "2>0")
	register_event("DeathMsg", "event_deathmsg", "a")
	register_event("ResetHUD", "event_resethud", "be")
	register_event("Spectator", "event_spectator", "a")
	
	cvar_heartbeathp = register_cvar("zp_heartbeat_hp", "50")
}

public event_damage(id)
{
	if (get_user_health(id) > get_pcvar_num(cvar_heartbeathp) || !zp_get_user_zombie(id))
		return;
	
	set_task(1.0, "show_effect", id)
}

public show_effect(id)
{
	if(is_user_alive(id) && zp_get_user_zombie(id))
	{
		set_task(1.0, "show_effect", id)

		static Float:FOrigin3[3] 
		pev(id, pev_origin, FOrigin3)

		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, FOrigin3, 0)
		write_byte(TE_PARTICLEBURST) // TE id
		engfunc(EngFunc_WriteCoord, FOrigin3[0]) // x
		engfunc(EngFunc_WriteCoord, FOrigin3[1]) // y
		engfunc(EngFunc_WriteCoord, FOrigin3[2]) // z
		write_short(50) // radius
		write_byte(72) // color
		write_byte(2) // duration (will be randomized a bit)
		message_end()
	}
	return PLUGIN_HANDLED
}
Vechta is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 06-28-2010 , 14:33   Re: What is wrong?
Reply With Quote #2

problem solved..
Vechta is offline
Reply


Thread Tools
Display Modes

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 14:51.


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