Jbc dam sma
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
new const nazwa[] = "Skoczek";
new const opis[] = "Posiada AutoBH LongJumpa co 3 sek 20 hp i pelen magazynek za fraga";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_AK47);
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new const grawitacja = 0;
new ma_klase[33];
new ostatni_skok[33];
new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
public plugin_init()
{
register_plugin(nazwa, "1.0", "Majster VVirus");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc, grawitacja);
register_forward(FM_PlayerPreThink, "fwPrethink_AutoBH");
}
public cod_class_enabled(id)
{
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public fwPrethink_AutoBH(id)
{
if(!ma_klase[id])
return PLUGIN_CONTINUE
if (pev(id, pev_button) & IN_JUMP) {
new flags = pev(id, pev_flags)
if (flags & FL_WATERJUMP)
return FMRES_IGNORED;
if ( pev(id, pev_waterlevel) >= 2 )
return FMRES_IGNORED;
if ( !(flags & FL_ONGROUND) )
return FMRES_IGNORED;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] += 250.0;
set_pev(id, pev_velocity, velocity);
set_pev(id, pev_gaitsequence, 6);
}
return FMRES_IGNORED;
}
public DeathMsg()
{
new killer = read_data(1);
if(!is_user_connected(killer))
return PLUGIN_CONTINUE;
if(ma_klase[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
set_pev(killer, pev_health, new_health);
new weapon = get_user_weapon(killer);
if(maxClip[weapon] != -1)
set_user_clip(killer, maxClip[weapon]);
}
return PLUGIN_CONTINUE;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}