Spróbuj tego
#include <amxmodx>
#include <codmod>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
new bool:moze_skoczyc[33];
new bool:ma_klase[33];
new const nazwa[] = "Kozak(MaxPremium)";
new const opis[] = "SCOUT 1/1 mniejsza widocznosc na SCOUCIE , podwojny skok oraz 30 % wiecej obrazen z m4a1 i HE 1/3";
new const bronie = 1<<CSW_SCOUT | 1<<CSW_DEAGLE | 1<<CSW_HEGRENADE;
new const zdrowie = 0;
new const kondycja = 30;
new const inteligencja = 20;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin(nazwa, "1.0", "Zielony Smerf")
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "CmdStart");
register_event("CurWeapon", "CurWeapon", "be", "1=1");
register_event("ResetHUD", "ResetHUD", "abe");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public CurWeapon(id)
{
if(!ma_klase[id])
return;
if(get_user_weapon(id) != CSW_SCOUT)
{
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
return;
}
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 50);
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
new damage=read_data(2)
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_SCOUT)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_HEGRENADE && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_M4A1)
damage*=0.3
}
return HAM_IGNORED;
}
public CmdStart(id, uc_handle)
{
if(!ma_klase[id])
return FMRES_IGNORED;
new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc[id])
{
moze_skoczyc[id] = false;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND)
moze_skoczyc[id] = true;
return FMRES_IGNORED;
}