←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
[Problem] Komplikacją klasy

KinderWEB - zdjęcie KinderWEB 02.07.2014

Więc piszę temat gdyż zrobiłem klasę wszystko dobrze i gites na 100% lecz nie chce się skąplikować ;( pomocy i mówcie jaki błąd zrobiłem ;( !

 

 

#include <amxmodx>

#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
#include <cstrike>
 
#define DMG_BULLET (1<<1)
        
new const nazwa[]   = "[FreePremium]Counter";
new const opis[]    = "Posiada : M4A1 + 15 dmg oraz AWP , ma 4 skoki , zestaw do rozbrajania + all granaty";
new const bronie    = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_AWP)|(1<<CSW_M4A1)|(1<<CSW_FLASHBANG);
new const zdrowie   = 10;
new const kondycja  = 30;
new const inteligencja = 10;
new const wytrzymalosc = 40;
    
new skoki[33];
 
new ma_klase[33];
 
public plugin_init()
{
register_plugin(nazwa, "1.0", "TerroR");
 
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
   
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
 
        RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
 
}
 
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");
cs_set_user_defuse(id, 1);
ma_klase[id] = true;
 
}
 
public cod_class_disabled(id)
{
ma_klase[id] = false;
 
}
 
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
 
new flags = pev(id, pev_flags);
 
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 4;
 
return FMRES_IGNORED;
 
 
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_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 15.0, 0.2, idinflictor, damagebits);
 
return HAM_IGNORED;
}
 

 

Odpowiedz

  • +
  • -
pro100wHS - zdjęcie pro100wHS 03.07.2014

łapaj ;)

 

Załączony plik  codclass_counter.sma   2,11 KB   19 Ilość pobrań

Odpowiedz

  • +
  • -
Alelluja - zdjęcie Alelluja 09.07.2014

Proszę

 

#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define DMG_BULLET (1<<1)
        
new const nazwa[]   = "[FreePremium]Counter ";
new const opis[]    = "M4A1 + 15 dmg oraz AWP , ma 4 skoki , zestaw do rozbrajania + all granaty";
new const bronie    = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_AWP)|(1<<CSW_M4A1)|(1<<CSW_FLASHBANG);
new const zdrowie   = 0;
new const kondycja  = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
 
new bool:ma_klase[33];

new skoki[33];

public plugin_init()
{
    register_plugin(nazwa, "1.0", "Alelluja");

    cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
   
    register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
    RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

}

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");
    cs_set_user_defuse(id, 1);
    ma_klase[id] = true;

}

public cod_class_disabled(id)
{
    ma_klase[id] = false;

}

public fwCmdStart_MultiJump(id, uc_handle)
{
    if(!is_user_alive(id) || !ma_klase[id])
        return FMRES_IGNORED;

    new flags = pev(id, pev_flags);

    if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
    {
        skoki[id]--;
        new Float:velocity[3];
        pev(id, pev_velocity,velocity);
        velocity[2] = random_float(265.0,285.0);
        set_pev(id, pev_velocity,velocity);
    }
    else if(flags & FL_ONGROUND)
        skoki[id] = 3;

    return FMRES_IGNORED;
}


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_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
        cod_inflict_damage(idattacker, this, 15.0, 0.0, idinflictor, damagebits);
    
    return HAM_IGNORED;
}

 

Odpowiedz