Raised This Month: $ Target: $400
 0% 

dhudkill spec


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BYSergey
Member
Join Date: Dec 2010
Location: Doneck City
Old 11-18-2015 , 11:54   dhudkill spec
Reply With Quote #1

Help please, I can not send a dhud message to someone watching(SPECTATING) killer.(bad engl)
Code:
#include <amxmodx>
#include <dhudmessage>
#define HUD_colorR		255	// default: 255
#define HUD_colorG		155	// default: 155
#define HUD_colorB		0	// default: 0
#define HUD_posX			0.9	// default: 0.6
#define HUD_posY			0.20	// default: 0.2
#define HUD_fx			0	// default: 0
#define HUD_fxTime		0.0	// default: 0.0
#define HUD_holdTime		1.0	// default: 1.0
#define HUD_fadeInTime		0.3	// default: 0.3
#define HUD_fadeOutTime		2.0	// default: 2.0
#define HUD_channel		-1	// default: -1
#define HUD_changeY		0.03	// default: -1
new timer = 0
new timer_start[33]
new timer_end[33]
new Float:displayY[33] = HUD_posY
new countkill[33]
public plugin_init()
{
	register_plugin("Kill Message", "1.0", "by4udilo") 
	register_event("DeathMsg","event_death","a") 
	set_task(1.0, "timer_event", _, _, _, "b")
}
public plugin_precache()
{
   precache_sound("events/enemy_died.wav")
}

public timer_event()
{
	timer++
}

public event_death(){
	new killer = read_data(1)
	new victim = read_data(2)
	timer_end[killer] = (timer - timer_start[killer])
	if(timer_end[killer] <= 4){
		displayY[killer] = (displayY[killer] + HUD_changeY)
	}else{
		displayY[killer] = HUD_posY
		countkill[killer] = 0
	}	
	
	set_dhudmessage(HUD_colorR, HUD_colorG, HUD_colorB, HUD_posX, displayY[killer], HUD_fx, HUD_fxTime, HUD_holdTime, HUD_fadeInTime, HUD_fadeOutTime)
	if(is_user_connected(killer))
	{
		if(killer == victim){
			show_dhudmessage(killer, "SOMETIMES IT HAPPENS")
		}else{
			if(countkill[killer] > 2 && timer_end[killer] <= 4){
				show_dhudmessage(killer, "DOMINATING!!! ")
				countkill[killer]++
			}
			if(countkill[killer] == 2 && timer_end[killer] <= 4){
				show_dhudmessage(killer, "KILL!KILL!KILL!")
				countkill[killer]++
			}
			if(countkill[killer] == 1 && timer_end[killer] <= 4){
				show_dhudmessage(killer, "KILL! KILL!  ")
				countkill[killer]++
			}
			if(countkill[killer] == 0){
				show_dhudmessage(killer, "KILL!     ")
				countkill[killer]++
			}
			emit_sound(killer,CHAN_AUTO,"events/enemy_died.wav",1.0,1.0,0,150)
			timer_start[killer] = timer	
		}
	}
}

Last edited by BYSergey; 11-19-2015 at 13:53. Reason: bad engl
BYSergey is offline
Send a message via Skype™ to BYSergey
 



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 17:50.


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