Raised This Month: $ Target: $400
 0% 

DeathMsg


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Adomaz1
Senior Member
Join Date: Feb 2014
Old 03-06-2017 , 08:42   Re: DeathMsg
Reply With Quote #5

I want to do something like this(the photo isn't mine):


In the console it shows that the player has been killed by a hegrenade, but not in the game. It just shows a worldspawn icon which I don't want. Instead of it I want it to show a hegrenade icon.

I tried doing it with make_deathmsg but it just makes an extra deathmsg so it looks like that the player has killed the enemy two times lol

Code:
public player_death()
{
new id = read_data(2);

if(!is_user_connected(id))
return PLUGIN_CONTINUE;

switch(us_get_zombie_class(id))
{
		case CLASS_ID_BOOMER:
		{	
			emit_sound( id, CHAN_STREAM, explode_sounds[ random_num( 0, 2 ) ], 1.0, ATTN_NORM, 0, PITCH_HIGH )
			
			gBoom(id);
			
			for(new i = 1; i <= 32; i++)
			{
				if( !is_valid_ent(i) || !is_user_alive(i) || !is_user_connected(i) || us_get_user_zombie(i) || get_entity_distance(id, i) > get_pcvar_num(cvar_boomer_explodedist))
					continue;
				
				message_begin(MSG_ONE, g_msgid_ScreenFade, _, i)
				write_short(get_pcvar_num(cvar_boomer_wakeuptime))
				write_short(get_pcvar_num(cvar_boomer_wakeuptime))
				write_short(0x0004)
				write_byte(79)
				write_byte(180)
				write_byte(61)
				write_byte(255)
				message_end()
				
				if( get_pcvar_num( cvar_boomer_victimrender ) )
					set_rendering( i, kRenderFxGlowShell, 79, 180, 61, kRenderNormal, 25 )
				
				new iGrenade = create_entity("weapon_hegrenade"); 
				if(pev_valid(iGrenade)) 
				{
					new Float:fDamage = get_pcvar_float(cvar_boomer_boom_damage);
					ExecuteHam(Ham_TakeDamage, i, iGrenade, id, fDamage, DMG_GRENADE);
					remove_entity(iGrenade);
				}
				set_task(get_pcvar_float(cvar_boomer_wakeuptime), "victim_wakeup", i+TASKID_WAKE_UP);
			}
		}
	}
return PLUGIN_CONTINUE;
}
I tried to do it like this but it didn't work :s

Code:
message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_byte(1); // status (0=hide, 1=show, 2=flash)
write_string("hegrenade"); // tried weapon_hegrenade, grenade, weapon_grenade but it didn't work
write_byte(0); // red
write_byte(255); // green
write_byte(0); // blue
message_end();

Last edited by Adomaz1; 03-06-2017 at 08:42.
Adomaz1 is offline
 



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 21:02.


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