←  Poradniki, Łatki oraz Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
[Poradnik] Jak dodać 1/x z noża PPM | LPM

  • +
  • -
Alelluja's Photo Alelluja 30.08.2015

Dodajcie:

 

#include <fakemeta_util>

 

lub  

 

#include <fakemeta>

 

Ale musicie dodać:

 

#include <hamsandwich>

 

Pod tym dodajcie:

 

#define DMG_BULLET (1<<1)

 

Do plugin_init:

 

RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

 

Na końcu:

 

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 && !(pev(idattacker, pev_button) & IN_ATTACK))
        cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
 

    return HAM_IGNORED;

}

 

Jeżeli chcielibyście z LPM to dajcie:

 

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 && !(pev(idattacker, pev_button) & IN_ATTACK2))
        cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

    return HAM_IGNORED;

}

 

Dobra teraz wam pokaże jak zrobić 1/x bo to wszystko na górze było 1/1

 

Robimy wszystko tak samo jak na górze tylko podmieniacie public na ten:

 

PPM

 

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 && !(pev(idattacker, pev_button) & IN_ATTACK) && damagebits & DMG_BULLET && random_num(1, X) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

        
    return HAM_IGNORED;
}

 

LPM

 

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 && !(pev(idattacker, pev_button) & IN_ATTACK2) && damagebits & DMG_BULLET && random_num(1, X) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

        
    return HAM_IGNORED;
}

 

W miejscie "X" wpisujemy daną liczbe.

 

 

Myślę że pomogłem.

 

Poradnik jest mojego Autorstwa.

Quote

  • +
  • -
Bonhart's Photo Bonhart 26.09.2015

Poradnik przydatny ++

Quote

  • +
  • -
1stADXionC's Photo 1stADXionC 28.09.2015

Były już tego typu poradniki. 

Quote

  • +
  • -
Alelluja's Photo Alelluja 29.09.2015

1stADXionC To podaj przynajmniej 1 link do takiego poradniku. Tylko z nożem.

Quote