Mam taki problem ponieważ dodałem strip_user_weapons do nożownika. Jak się dostanie perk "Sekret Krowy" - który daje M249 to w następnej rundzie jej nie ma, a perk nadal jest wyświetlany.
Nożownik - .SMA:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <fun>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Nozownik";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)";
new const bronie = 1<<CSW_KNIFE;
new const zdrowie = 50;
new const kondycja = 76;
new const inteligencja = 10;
new const wytrzymalosc = 3;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
ma_klase[id] = false;
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
public Spawn(id)
{
if(ma_klase[id])
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
}
}
Sekret Krowy - .SMA:
#include <amxmodx>
#include <hamsandwich>
#include <codmod>
#define DMG_BULLET (1<<1)
new const perk_name[] = "Sekret Krowy";
new const perk_desc[] = "Dostajesz krowe i dodatkowe 15 obrazen z niej.";
new bool:ma_perk[33];
public plugin_init()
{
register_plugin(perk_name, "1.0", "Hajto");
cod_register_perk(perk_name, perk_desc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_perk_enabled(id)
{
cod_give_weapon(id, CSW_M249);
ma_perk[id] = true;
}
public cod_perk_disabled(id)
{
cod_take_weapon(id, CSW_M249);
ma_perk[id] = false;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_perk[idattacker])
return HAM_IGNORED;
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M249 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 15.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
Pozdrawiam i z góry dziękuję.
Użytkownik V!p3r edytował ten post 27.01.2011 19:40