Quote:
Originally Posted by BlizzardPeru
Could you add a HUD that says: Player "X" made the first blood gets a Money + HP + ARMOR Bonus?
|
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_sound ( "misc/firstblood.wav" );
}
public event_death ( ) {
new attacker = read_data ( 1 )
if ( ! g_bFirstKill ) {
new szName[33]
get_user_name(attacker, szName, charsmax(szName))
g_bFirstKill = true
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_sound( 0, CHAN_AUTO, "misc/firstblood.wav", 0.7, ATTN_NORM, 0, PITCH_NORM );
set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(0, "Player %s made the first kill and got +15 HP, +15 AR & 2000$ !", szName)
}
}
public event_new_round ( )
g_bFirstKill = false