 |
|
BANNED
Join Date: May 2006
Location: Mexico City, Mexico
|

05-26-2006
, 01:51
|
#4
|
go here -> http://wiki.amxmodx.org/index.php/Ad...28AMX_Mod_X%29
look about a third of the way down the page for these two code sample blocks... they *may* be germaine to what you are coding:
(I'm thinking you want hook_death...)
Quote:
Code:
public plugin_init()
{
register_plugin("Message Demo", "1.0", "BAILOPAN")
//this message informs everyone of a death, so we use
// flag "a" - global event
register_event("DeathMsg", "hook_death", "a")
}
public hook_death()
{
new Killer = read_data(1) //get the first message parameter
new Victim = read_data(2) //get the second message parameter
new headshot = read_data(3) //was this a headshot?
new weapon[32]
read_data(4, weapon, 31) //get the weapon name
}
Or, let's say we want to make a simple function for generating a death message:
Code:
stock make_deathMsg(Killer, Victim, const weapon[])
{
//message_begin starts a message. NEVER start two messages at once.
//MSG_ALL means send the message to everyone
//get_user_msgid returns the id of a message name
//{0,0,0} is the origin vector - not used here
//0 is the target - no specific target here
message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0)
write_byte(Killer)
write_byte(Victim)
write_string(weapon)
message_end()
}
|
|
|
|
|