#include <amxmodx>
#include <reapi>
#define IsPlayer(%1) (1 <= %1 <= MaxClients)
#define BONUS_HP 100 // amount HP
#define BONUS_AP 100 // amount AP
#define BONUS_MONEY 5000 // amount money
#define DHUD // Вывод информации в DHUD
#define CHAT // Вывод информации в Чат
new g_iKills[MAX_CLIENTS + 1]
public plugin_init()
{
register_plugin("Bonus Kill", "1.9", "I Am LeGenD")
RegisterHookChain(RG_CSGameRules_RestartRound, "@CSGameRules_RestartRoundPost", true)
RegisterHookChain(RG_CSGameRules_PlayerKilled, "@CSGameRules_PlayerKilledPost", true)
}
@CSGameRules_RestartRoundPost() {
arrayset(g_iKills, 0, sizeof(g_iKills))
}
public client_disconnected(player) {
g_iKills[player] = 0
}
@CSGameRules_PlayerKilledPost(const victim, const killer)
{
new Float: flHealth = Float: get_entvar(killer, var_health)
new Float: flAmmor = Float: get_entvar(killer, var_armorvalue)
g_iKills[victim] = 0
if(IsPlayer(killer))
{
if(g_iKills[killer] > 7)
return
if(victim != killer)
g_iKills[killer]++
#if defined DHUD
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 4.0)
#endif
switch(g_iKills[killer])
{
case 2:
{
rg_give_item(killer, "weapon_hegrenade")
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3HE гранату")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили HE гранату")
#endif
}
case 3:
{
rg_give_item(killer, "weapon_flashbang")
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3Flash гранату")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили Flash гранату")
#endif
}
case 4:
{
if(flAmmor < BONUS_AP.0) set_entvar(killer, var_armorvalue, BONUS_AP.0)
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3Броню")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили Броню")
#endif
}
case 5:
{
if(flHealth < BONUS_HP.0) set_entvar(killer, var_health, BONUS_HP.0)
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3Здоровье")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили Здоровье")
#endif
}
case 6:
{
rg_instant_reload_weapons(killer)
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3Перезарядку оружия")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили Перезарядку оружия")
#endif
}
case 7:
{
rg_add_account(killer, get_member(killer, m_iAccount) + (BONUS_MONEY * g_iKills[killer]), AS_SET)
#if defined CHAT
client_print_color(killer, print_team_default, "[^4Bonus Kill^1] Вы получили ^3Вознаграждение")
#endif
#if defined DHUD
show_dhudmessage(killer, "Вы получили Вознаграждение")
#endif
}
}
}
}