untested, but this should explain it a bit more..
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Grenade Bonus"
#define VERSION "1.0"
#define AUTHOR "OptimuS"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "playerDeath", "a", "1>0")
}
public playerDeath()
{
new killer = read_data(1) //get the fragger's _index_
new victim = read_data(2) //get the dead persons index
new weapon[8]
read_data(4, weapon, 7)
if (killer != victim && equal(weapon, "grenade"))
{
new clip, ammo
//new const uid = get_user_index(killer) //not needed since killer = uid
get_user_ammo(killer, CSW_HEGRENADE, clip, ammo)
if(ammo == 0)
{
give_item(killer, "weapon_hegrenade")
}
}
}
__________________