#include <amxmodx>
#include <fun>
new pMaxHP, pAddHP, pHsAddHP, pOnlyAdmins;
new AddHP, HsAddHP, MaxHP, oAdmins;
new g_HudSyncMsg;
new killer_HP, killerID;
//new g_ScreenMsg;
new g_iAdmin[33];
public plugin_init()
{
#define Version "1.3"
register_plugin("Lite Vampire + Fade", Version, "neygomon");
register_cvar("lv_neygomon", Version, FCVAR_SERVER | FCVAR_SPONLY)
register_event("DeathMsg", "eDeathMsg", "a", "1>0");
//g_ScreenMsg = get_user_msgid("ScreenFade");
pMaxHP = register_cvar("lv_maxhp", "100"); // Максимум HP
pAddHP = register_cvar("lv_addhp", "10"); // Добавление за убийство в тело
pHsAddHP = register_cvar("lv_hsaddhp", "15"); // Добавление за убийство в лицо :D
pOnlyAdmins = register_cvar("lv_oadmins", "0"); // Все функции плагина только для админов
g_HudSyncMsg = CreateHudSyncObj();
//g_ScreenMsg = get_user_msgid("ScreenFade");
set_task(1.5, "Load_Cfg");
}
public Load_Cfg()
{
AddHP = get_pcvar_num(pAddHP);
HsAddHP = get_pcvar_num(pHsAddHP);
MaxHP = get_pcvar_num(pMaxHP);
oAdmins = get_pcvar_num(pOnlyAdmins);
}
public client_putinserver(id)
{
if(oAdmins)
{
if(get_user_flags(id) & ADMIN_MENU) g_iAdmin[id] = 1;
else g_iAdmin[id] = 0;
}
}
public eDeathMsg()
{
if(((killerID = read_data(1)) == read_data(2)) || (oAdmins && !g_iAdmin[killerID]))
return;
killer_HP = get_user_health(killerID);
static TempHP; TempHP = (read_data(3) == 1) ? HsAddHP : AddHP;
set_user_health(killerID, ((killer_HP += TempHP) > MaxHP) ? MaxHP : killer_HP);
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1);
ShowSyncHudMsg(killerID, g_HudSyncMsg, "Добавлено +%d HP", TempHP);
/*static id;
if((id = read_data(1)) == read_data(2))
return;
message_begin(MSG_ONE, g_ScreenMsg, {0, 0, 0}, id);
write_short(1<<10);
write_short(1<<10);
write_short(0x0000);
write_byte(0);
write_byte(0); // R
write_byte(200); // G
write_byte(75); // B
message_end(); */
}