This is how I would implement it. Sorry if I messed up your formatting.
Code:
#include <amxmodx>
#include <fun>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new Float:lastDeathMsg[33] // bugfix
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","giveItem","a")
}
public giveItem() {
new killer = read_data(1)
new victim = read_data(2)
// bugfix
new Float:now = get_gametime()
if(lastDeathMsg[victim] - now < 0.2)
return;
lastDeathMsg[victim] = now
new kName[32], vName[32]
get_user_name(killer,kName,31)
get_user_name(victim,vName,31)
client_print(0,print_chat,"Killer: %s - Victim: %s",kName,vName)
if (killer != victim) {
give_item(killer,"weapon_hegrenade")
}
}
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS