#include <amxmodx>
#include <hamsandwich>
#include <codmod>
#include <engine>
#include <colorchat>
#include <fun>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Niewidzialny (Zasluzony)";
new const opis[] = "Niewidzialny, klasa tylko dla zasluzonych, natychmiastowe zabicie z noza, scout";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_DEAGLE | 1<<CSW_SCOUT | 1<<CSW_FLASHBANG | 1<<CSW_HEGRENADE | 1<<CSW_SMOKEGRENADE;
new const zdrowie = 100;
new const kondycja = 100;
new const inteligencja = 100;
new const wytrzymalosc = 10;
public plugin_init()
{
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_Spawn, "player", "Resp", 1);
register_event("CurWeapon","CurWeapon","be", "1=1");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_G))
{
ColorChat(id, RED, "[Niewidzialny] Nie masz uprawnien, aby uzywac tej klasy. (wiecej info na forum www.CSWolaWest.pl)") //Napis ktory wyswietli sie jak gracz nie ma flagi
return COD_STOP;
}
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 1);
ma_klase[id] = true;
Resp(id);
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
}
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_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_KNIFE && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
public Resp(id)
{
if(ma_klase[id])
{
give_item(id, "item_thighpack");
}
}
DefuseKit działa, sprawdzałem
