And here I've added some more abbilities in your messages,
swapped! I've got the victim and attacke names, also added some colors to the chat messages! Here you go:
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_event("DeathMsg", "death_msg_function", "a");
}
public death_msg_function()
{
new victim = read_data( 2 );
new attacker = read_data( 1 );
new hs = read_data( 3 );
new NameVictim[32]
get_user_name(victim, NameVictim, 31)
new NameAttacker[32]
get_user_name(attacker, NameAttacker, 31)
if(hs)
{
ColorMessage(victim, "You have been headshoted by %s!", NameAttacker)
ColorMessage(attacker, "You have headshoted %s!", NameVictim);
}
else
{
ColorMessage(victim, "You have been normal killed by %s", NameAttacker);
ColorMessage(attacker, "You have normal killed %s", NameVictim);
}
}
/*You can add some colors to the chat messages
^4 - green color
^3 - team color
^1 - normal chat color
Example: ^3You have been ^4headshoted ^3by ^4%s!*/
stock ColorMessage(const id, const input[], any:...){
new count = 1, players[32];
static msg[ 191 ];
vformat(msg, 190, input, 3);
if (id) players[0] = id; else get_players(players , count , "ch"); {
for (new i = 0; i < count; i++){
if (is_user_connected(players[i])){
message_begin(MSG_ONE_UNRELIABLE , get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();}}}
}