AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Consultation about "make_deathmsg" (https://forums.alliedmods.net/showthread.php?t=47251)

Ryu2877 11-13-2006 07:24

Consultation about "make_deathmsg"
 
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.

dutchmeat 11-13-2006 08:55

Re: Consultation about "make_deathmsg"
 
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 :)

VEN 11-13-2006 10:01

Re: Consultation about "make_deathmsg"
 
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.
*/


Ryu2877 11-14-2006 02:44

Re: Consultation about "make_deathmsg"
 
Thanks dutchmeat & VEN !
Now the other plugin can hook the message,thanks very much!

dutchmeat 11-14-2006 04:42

Re: Consultation about "make_deathmsg"
 
You are welcome :)

JoshGomez 08-23-2007 09:32

Re: Consultation about "make_deathmsg"
 
how to block fakedamage's deathmsg?


All times are GMT -4. The time now is 06:59.

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