←  Prośby o Klasę/Item

AMXX.pl: Support AMX Mod X i SourceMod

»

Klasa
Klasa Diabel

  • +
  • -
4M4ToR - zdjęcie 4M4ToR 18.01.2014

Nazwa klasy Diabel.

Posiada wlasny model diabla

Wlasny nóż.

I jakąś super moc.

DAJE NAJ +

Odpowiedz

IceBaRa - zdjęcie IceBaRa 18.01.2014

#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
        
new const nazwa[]   = "Diabel";
new const opis[]    = "Nie widzialny na nozu";
new const bronie    = (1<<CSW_M249)|(1<<CSW_M4A1)|(1<<CSW_DEAGLE);
new const zdrowie   = 10;
new const kondycja  = 10;
new const inteligencja = 10;
new const wytrzymalosc = 10;
    
new ma_klase[33];

public plugin_init()
{
	register_plugin(nazwa, "1.0", "amxx.pl");

	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

	register_event("CurWeapon", "eventKnife_Niewidzialnosc", "be", "1=1");


	register_event("Damage", "Damage_Wyrzucenie", "b", "2!=0");

	RegisterHam( Ham_Spawn, "player", "fwSpawn_ModelGracza" );

	register_event("CurWeapon", "ModelBroni_CurWeapon", "be", "1=1");
	register_forward(FM_SetModel, "ModelBroni_fw_SetModel");
	RegisterHam(Ham_TakeDamage, "player", "SzansaNaHeadshot_TakeDamage");
}

public plugin_precache()
{

	static szModel[ ] = "models/player/models/diabel.mdl/models/diabel.mdl.mdl";
	precache_model( szModel );
	precache_model("models/new_noz/p_diabel.mdl");
	precache_model("models/new_noz/v_diabel.mdl");
	precache_model("models/new_noz/w_diabel.mdl");
}

public cod_class_enabled(id)
{
	ma_klase[id] = true;

}

public cod_class_disabled(id)
{
	set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
    	ma_klase[id] = false;

}

public eventKnife_Niewidzialnosc(id)
{
	if(!ma_klase[id])
		return;

	if( read_data(2) == CSW_KNIFE )
	{
		set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
	}
	else
	{
		set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
	}
}

public Damage_Wyrzucenie(id)
{
	new idattacker = get_user_attacker(id);

	if(!is_user_alive(idattacker))
		return;

	if(!ma_klase[idattacker])
		return;

	if(random_num(1, 4) != 1)
		return;

	client_cmd(id, "drop");
}

public fwSpawn_ModelGracza( id )
{
	if( !is_user_alive( id ) || !ma_klase[ id ] )
		return;

	engfunc( EngFunc_SetClientKeyValue, id, engfunc( EngFunc_GetInfoKeyBuffer, id ), "model", "models/diabel.mdl" );
}

public ModelBroni_CurWeapon(id)
{
        new weapon = read_data(2);

        if(ma_klase[id])
        {
                if(weapon == CSW_KNIFE)
                {
                        set_pev(id, pev_viewmodel2, "models/new_noz/v_diabel.mdl")
                        set_pev(id, pev_weaponmodel2, "models/new_noz/p_diabel.mdl")
                }
        }
}

public ModelBroni_fw_SetModel(entity, model[])
{
        if(!pev_valid(entity))
                return FMRES_IGNORED

        if(!equali(model, "models/w_knife.mdl"))
                return FMRES_IGNORED;

        new entityowner = pev(entity, pev_owner);

        if(!ma_klase[entityowner])
                return FMRES_IGNORED;

        engfunc(EngFunc_SetModel, entity, "models/new_noz/w_diabel.mdl")
        return FMRES_SUPERCEDE
}

public SzansaNaHeadshot_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_alive(idattacker) || !ma_klase[idattacker])
		return HAM_IGNORED;

	if(get_user_hitzones(idattacker, this) != 2 && !random(5))
	{
		set_user_hitzones(idattacker, this, 2);
	}
	
	return HAM_IGNORED;
}

Edytuj siceizke modelu czlowieka teraz jest models/diabel.mdl
a modele noza to models/new_noz/p_diabel.mdl

models/new_noz/v_diabel.mdl

models/new_noz/w_diabel.mdl

jest nie widzialny na nozu

Odpowiedz