#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#define DMG_BULLET (1<<1)
#define DMG_HEGRENADE (1<<24)
#define AUTHOR "Mentos"
new const nazwa[] = "Come Back [VIP]";
new const opis[] = "Gdy stoisz w miejscu nie widac cie oraz 1/2 z HE";
new const bronie = 1<<CSW_HEGRENADE | 1<<CSW_MP5NAVY | 1<<CSW_DEAGLE;
new const zdrowie = 20;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 20;
new bool:ma_klase[33]
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_plugin(nazwa, "1.0", "Mentos");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_F))
{
client_print(id, print_chat, "[Come Back] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public client_PreThink ( id )
{
new button2 = get_user_button(id);
//USE Button actives forward\backward\left\right
if (ma_klase[id] && get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) && is_user_alive(id)))
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 9);
}
else set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
return PLUGIN_CONTINUE
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_HEGRENADE && random_num(1, 2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(damagebits & DMG_BULLET)
{
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_MP5NAVY && damagebits & DMG_BULLET && random_num(1, 10) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}