Raised This Month: $ Target: $400
 0% 

DeathMsg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 03-05-2017 , 07:03   DeathMsg
Reply With Quote #1

How can I make a diffrent DeathMsg? It already shows that the player was killed by worldspawn in the console, but how can I make that it would show worldspawn ingame instead of a knife? I searched for answers and found that it has something to do with TruncatedWeaponName, but I didn't find something similar in what I want. :s
Adomaz1 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-05-2017 , 11:13   Re: DeathMsg
Reply With Quote #2

Not 100% sure what you want your end result to be. Have you tried:

make_deathmsg( idKiller , idVictim , headshot (0 or 1) , "knife")
__________________

Last edited by Bugsy; 03-05-2017 at 11:13.
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-05-2017 , 12:01   Re: DeathMsg
Reply With Quote #3

Try to hook ham killed pre. And check if user commiting a suicide and check the dmgbits and do new sucide deathmsg etc.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-05-2017 at 12:01.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-06-2017 , 02:48   Re: DeathMsg
Reply With Quote #4

Post your code.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-06-2017 , 10:50   Re: DeathMsg
Reply With Quote #6

PHP Code:
register_message(get_user_msgid("DeathMsg"), "Message_DeathMsg");
...
public 
Message_DeathMsg(msg_idmsg_destid)
{
    static 
attackervictimweapon[24];
    
    
attacker read_data(1);
    
victim read_data(2);
    
read_data(4weapon23);

    if(!
is_user_connected(attacker))
        return 
PLUGIN_CONTINUE
        
    
if(equali(weapon"aug") && g_user_has_[attacker]))
        
set_msg_arg_string(4"katana");

    return 
PLUGIN_CONTINUE

I just based this on your sample screenshot, thus the "aug" is replaced by the "katana". You'll also need your own custom sprite and edit the hud.txt in cstrike/sprites folder for this to work...
__________________
hellmonja is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 03-07-2017 , 08:17   Re: DeathMsg
Reply With Quote #7

You should use grenade instead of hegrenade and weapon_hegrenade.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
killerZM
Senior Member
Join Date: Sep 2016
Old 03-07-2017 , 13:08   Re: DeathMsg
Reply With Quote #8

i can make new icon for death ? like i had my own weapon and i want to change icon to be someting else
hellmonja way is right ?
killerZM is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-07-2017 , 13:54   Re: DeathMsg
Reply With Quote #9

You can but only for yourself (client-side), it's not something that clients can just download.

Last edited by klippy; 03-07-2017 at 13:55.
klippy is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 03-08-2017 , 09:32   Re: DeathMsg
Reply With Quote #10

i cant just make a txt file and put sprite resolution . etc in it ?
killerZM 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 21:03.


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