#include <amxmodx>
#include <fakemeta>
#include <codmod>
static const _CSW_to_offset[] =
{
0, 385, 378, 388, 381, 390, 382, 389,
386, 383, 382, 380, 380, 380, 382, 386,
377, 386, 379, 381, 380, 386, 378, 387,
384, 380, 378, 0, 383
};
new const nazwa[] = "Plutonowy";
new const opis[] = "Wbudowane zwinne palce";
new const bronie = 1<<CSW_UMP45;
new const zdrowie = 15;
new const kondycja = 65;
new const inteligencja = 0;
new const wytrzymalosc = 5;
new ma_klase[33];
new const max_clip[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", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "CmdStart");
}
public cod_perk_enabled(id)
ma_klase[id] = true;
public cod_perk_disabled(id)
ma_klase[id] = false;
public CmdStart(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new buttons = get_uc(uc_handle, UC_Buttons);
new oldbuttons = pev(id, pev_oldbuttons);
new clip, ammo, weapon = get_user_weapon(id, clip, ammo);
if(max_clip[weapon] == -1 || !ammo)
return FMRES_IGNORED;
if((buttons & IN_RELOAD && !(oldbuttons & IN_RELOAD) && !(buttons & IN_ATTACK)) || !clip)
{
fm_cs_set_user_bpammo(id, weapon, ammo-(max_clip[weapon]-clip));
new new_ammo = (max_clip[weapon] > ammo)? clip+ammo: max_clip[weapon]
set_user_clip(id, new_ammo);
}
return FMRES_IGNORED;
}
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;
}
stock fm_cs_set_user_bpammo(id, weapon, ammo)
{
set_pdata_int(id, _CSW_to_offset[weapon], ammo, 5);
}
W tej klasie sa juz zwinne palce wystarczy zrobic reszte tak jak nizej
[P] Killer
Broń: M4A1,P90, DGL
Umiejętności: Posiada M4A1, ma 4min i he 1/2 oraz wbudowane zwinne palce.
Inteligencja: 5
Życie: 10
Wytrzymałość: 25
Kondycja:25
1pkt inty = 1 DMG (Miny)
Prosił bym o gotowa klase która mozna wgrac na serwer.