Just need to check whether the attacker is alive or not. ;)
Just use below:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new bool: g_bFirstKill
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event ( "DeathMsg", "event_death", "a" )
register_event ( "HLTV", "event_new_round", "a", "1=0", "2=0" )
}
public plugin_precache ( )
{
// Precache our custom sound when first blood is happen
precache_sound ( "misc/firstblood.wav" );
}
public event_death ( )
{
new attacker = read_data ( 1 )
// If the attacker is dead or
// the attacker is the same with the victim (this mean the player has committed suicide,
// then the first blood reward will be paused
if ( !is_user_alive(attacker) || attacker == read_data ( 2 ) )
return
// If there is still nobody drew a first blood
if ( ! g_bFirstKill )
{
// First blood has happen
g_bFirstKill = true
// The reward for first blood
cs_set_user_money ( attacker, cs_get_user_money ( attacker ) + 2000 )
set_user_health ( attacker, get_user_health ( attacker ) + 15 )
set_user_armor ( attacker, get_user_armor ( attacker ) + 15 )
// Emit a sound
emit_sound( 0, CHAN_AUTO, "misc/firstblood.wav", 0.7, ATTN_NORM, 0, PITCH_NORM );
}
}
public event_new_round ( )
{
// Reset our first blood in the new round
g_bFirstKill = false
}