←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Na hita z LPM

Locked

  • +
  • -
Vethelzo's Photo Vethelzo 01.09.2011

Witam mam pytanko, czy istnieje możliwość zmodyfikowania klasy komandosa w ten sposób, aby zabijał na hita z LPM, a nie z PPM?
Quote

Skull3D's Photo Skull3D 01.09.2011

Tak.
Quote

  • +
  • -
A może sma?'s Photo A może sma? 01.09.2011

Istnieje.
Quote

  • +
  • -
Kapi^'s Photo Kapi^ 01.09.2011

Powinno działać :

if(weapon == CSW_KNIFE) { if(informacje_przedmiotu_gracza[this][0] == 4) damage=damage*1.4+inteligencja_gracza[idattacker]; if(informacje_przedmiotu_gracza[idattacker][0] == 8 || (klasa_gracza[idattacker] == Snajper && random(2) == 2) || klasa_gracza[idattacker] == Komandos && !(get_user_button(idattacker) & IN_ATTACK) || klasa_gracza[idattacker] == Haunter && !(get_user_button(idattacker) & IN_ATTACK)) damage = float(health); }

Quote

  • +
  • -
severe's Photo severe 01.09.2011

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <hamsandwich>

#define DMG_BULLET (1<<1)


new bool:ma_klase[33];

new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(LPM)";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;

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");
}

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 > 1.0)
        cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
        
    return HAM_IGNORED;
}

To na sto procent działa.
Quote

  • +
  • -
Vethelzo's Photo Vethelzo 01.09.2011

severe dzięki działa plusik dla ciebie leci :)
Quote

  • +
  • -
A może sma?'s Photo A może sma? 02.09.2011

    if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 1.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

na:
    if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
Quote
Locked