/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
new const nazwa[] = "Cpun";
new const opis[] = "Ma podwojny skok, mniejsza grawitacje i HE co 1 minute.";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 35;
new const kondycja = 5;
new const inteligencja = 10;
new const wytrzymalosc = 5;
new ma_klase[33];
new bool:moze_skoczyc[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "BloodMan");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "CmdStart");
set_task(60.0, "he", _, _, _, "b");
}
public cod_class_enabled(id)
{
set_user_gravity (id, 0.5)
ma_klase[id] = 1
}
public cod_class_disabled(id)
{
cod_take_weapon(id, CSW_HEGRENADE);
set_user_gravity (id, 1.0)
ma_klase[id] = 0
}
public he(id)
{
cod_give_weapon(id, CSW_HEGRENADE);
}
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;
}