mam pewien problem z klasą ZłotyManiak chciałem mu dodać 2 nowe wyglądy broni działa aby Deagle a ak47 już nie wszystko się ładnie komplikuje proszę o pomoc
OTO SMA
Spoiler
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <ColorChat>
#include <fakemeta_util>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
new bool:ma_klase[33];
new bool:g_bMaKlase[33];
new const nazwa[] = "ZlotyMANIAK";
new const opis[] = "Posiada zlotego deagle oraz AK47.";
new const bronie = (1<<CSW_DEAGLE)|(1<<CSW_AK47);
new const zdrowie = 100;
new const kondycja = 100;
new const inteligencja = 0;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin("ZlotyMANIAK, "v0.1", "KluchoPL")
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("CurWeapon","eventCurWeapon", "b")
register_event("CurWeapon","CurWeapon","be", "1=1");
register_event("CurWeapon", "CurWeapon1", "be", "1=1")
register_forward(FM_SetModel, "fw_SetModel");
}
public plugin_precache()
{
precache_model("models/SeriaA/w_deagle_gold.mdl");
precache_model("models/SeriaA/p_deagle_gold.mdl");
precache_model("models/SeriaA/v_deagle_gold.mdl");
precache_model("models/SeriaA/w_ak47.mdl");
precache_model("models/SeriaA/p_ak47.mdl");
precache_model("models/SeriaA/v_ak47.mdl");
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public eventCurWeapon(id)
{
if(!g_bMaKlase[id])
return PLUGIN_CONTINUE
new iWeapon = read_data(2);
new iEnt;
static Float:fSpeedMultiplier = 0.3;
if(iWeapon == CSW_DEAGLE | CSW_AK47)
{
iEnt = fm_find_ent_by_owner(-1, "weapon_deagle weapon_ak47", 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 );
}
return PLUGIN_CONTINUE
}
public CurWeapon(id)
{
if(!is_user_connected(id))
return;
if(!ma_klase[id])
return;
set_user_clip(id, 31);
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}
public CurWeapon1(id)
{
new weapon = read_data(2);
if(ma_klase[id])
{
if(weapon == CSW_DEAGLE | CSW_AK47)
{
set_pev(id, pev_viewmodel2, "models/SeriaA/v_deagle_gold.mdl")
set_pev(id, pev_weaponmodel2, "models/SeriaA/p_deagle_gold.mdl")
set_pev(id, pev_viewmodel2, "models/SeriaA/v_ak47.mdl")
set_pev(id, pev_weaponmodel2, "models/SeriaA/p_ak47.mdl")
}
}
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED
if(!equali(model, "models/w_deagle.mdl"))
if(!equali(model, "models/w_ak47.mdl"))
return FMRES_IGNORED;
new entityowner = pev(entity, pev_owner);
if(!ma_klase[entityowner])
return FMRES_IGNORED;
engfunc(EngFunc_SetModel, entity, "models/SeriaA/w_deagle_gold.mdl")
engfunc(EngFunc_SetModel, entity, "models/SeriaA/w_ak47.mdl")
return FMRES_SUPERCEDE
}
proszę O POMOC BARDZO


Dodatki SourceMod













