klasa wywala mi errory, serwer nie pada, ale przydało by się je poprawić. Pomoże ktoś?
L 01/11/2012 - 03:37:16: Start of error session. L 01/11/2012 - 03:37:16: Info (map "de_nuke") (file "addons/amxmodx/logs/error_20120111.log") L 01/11/2012 - 03:37:16: Invalid event (name "Spawn") (plugin "codclass_elitarnyzolnierz.amxx") L 01/11/2012 - 03:37:16: [AMXX] Displaying debug trace (plugin "codclass_elitarnyzolnierz.amxx") L 01/11/2012 - 03:37:16: [AMXX] Run time error 10: native error (native "register_event") L 01/11/2012 - 03:37:16: [AMXX] [0] codclass_elitarnyzolnierz_323487.sma::plugin_init (line 36)
a oto kod klasy
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Elitarny zolnierz";
new const opis[] = "Dwie MP5, dodatkowe 5(+inteligencja) obrazen";
new const bronie = (1<<CSW_MP5NAVY | 1<<CSW_ELITE);
new const zdrowie = 15;
new const kondycja = 7;
new const inteligencja = 0;
new const wytrzymalosc = 3;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("CurWeapon", "CurWeapon", "be", "1=1");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_event("Spawn", "Spawn", "be", "1=1")
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
ma_klase[id] = false;
public Spawn(id)
{
if(ma_klase[id])
cs_set_user_bpammo(id, CSW_MP5NAVY, 200)
}
public plugin_precache()
{
precache_model("models/v_mp5dual.mdl");
//powyżej zmieniasz ścieżki do nowych modeli
}
public CurWeapon(id)
{
new weapon = read_data(2);
if(ma_klase[id]) //tutaj wstawiamy ma_klase lub ma_perk
{
if(weapon == CSW_MP5NAVY) //tutaj ustawiamy broń, jakiej model będziemy zmieniać
{
set_pev(id, pev_viewmodel2, "models/v_mp5dual.mdl")
//tu dajemy ścieżkę do nowego modeli v_
}
}
new iWeapon = read_data(2);
new iEnt;
static Float:fSpeedMultiplier = 0.85;
if(iWeapon == CSW_MP5NAVY)
{
iEnt = fm_find_ent_by_owner(-1, "weapon_mp5navy", id)
set_pdata_float( iEnt, 46, ( get_pdata_float(iEnt, 46, 4) * fSpeedMultiplier), 4 );
set_pdata_float( iEnt, 47, ( get_pdata_float(iEnt, 47, 4) * fSpeedMultiplier), 4 );
}
}
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_MP5NAVY && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 5.0, 0.19, idinflictor, damagebits);
return HAM_IGNORED;
}


Dodatki SourceMod













