Raised This Month: $ Target: $400
 0% 

Consultation about "make_deathmsg"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 11-13-2006 , 07:24   Consultation about "make_deathmsg"
Reply With Quote #1

Hello everyone !
Here is my muddle :
I were using "make_deathmsg ( killer, victim, headshot, weapon[] ) " to made a death message.
But the "DeathMsg" event could not catch this message.
So i'm compelled to using "fakedamage" and "Damage" event to make/judge it.
As you know that's heavy and complicated.
It's this function just make a "fake" message? Or i miss something?
Someone can helped me? Thanks!
Sorry for my bad English.

Last edited by Ryu2877; 11-13-2006 at 07:49.
Ryu2877 is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-13-2006 , 08:55   Re: Consultation about "make_deathmsg"
Reply With Quote #2

I have never used make_deathmsg, but you can try this:

Code:
register_message(get_user_msgid("DeathMsg"), "deathmessage")

Code:
 
public deathmessage(msg_id, msg_dest, msg_entity){
new killer = get_msg_arg_int(1) 
new victim = get_msg_arg_int(2)
new headshot = get_msg_arg_int ( 3 )
new weapon[32] 
format(weapon,31,"weapon_mynewweapon"); 
make_deathmsg(killer,victim,headshot,weapon[]) 
return PLUGIN_CONTINUE
}
You really should work on that english of yours
dutchmeat is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-13-2006 , 10:01   Re: Consultation about "make_deathmsg"
Reply With Quote #3

make_deathmsg - is just to send a DeathMsg message to the client(s).
fakedamage - is to kill the user by dealing a real damage

If you want to send a hookable DeathMsg you can modify make_deathmsg stock function to use ewrite_* and emessage_* natives.
Code:
stock emake_deathmsg(killer,victim,headshot,weapon[]) {     emessage_begin(MSG_ALL,get_user_msgid("DeathMsg"),{0,0,0},0)     ewrite_byte( killer )     ewrite_byte( victim )     new mod_name[32]     get_modname(mod_name,31)     if (equal(mod_name,"cstrike") || equal(mod_name,"czero") || equal(mod_name,"csv15") || equal(mod_name,"cs13"))         ewrite_byte( headshot )     ewrite_string( weapon )     emessage_end()     return 1 }


But read this notes before you going to use the modified function.
Quote:
Originally Posted by messages.inc
/* ... are also sent to all other plugins and Metamod plugins.
* This means that if you send one of these messages, other plugins will
* be notified, which was previously impossible.
* BE CAREFUL! Using these incorrectly, or not for their intended purpose,
* could cause infinite recursion or something just as bad.
* NOTE! These natives are experimental.
*/

Last edited by VEN; 11-13-2006 at 10:04.
VEN is offline
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 11-14-2006 , 02:44   Re: Consultation about "make_deathmsg"
Reply With Quote #4

Thanks dutchmeat & VEN !
Now the other plugin can hook the message,thanks very much!
Ryu2877 is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-14-2006 , 04:42   Re: Consultation about "make_deathmsg"
Reply With Quote #5

You are welcome
dutchmeat is offline
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 08-23-2007 , 09:32   Re: Consultation about "make_deathmsg"
Reply With Quote #6

how to block fakedamage's deathmsg?
JoshGomez 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 20:48.


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