Proszę bardzo. pliki modelu wgrywasz tak jak są w paczce, pliki .wav (z noża) wgrywasz do sound/weapons oraz model noża to /model
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
new const nazwa[] = "Assasin(Premium)";
new const opis[] = "Mega zabojca";
new const bronie = 0;
new const zdrowie = 60;
new const kondycja = 45;
new const inteligencja = 20;
new const wytrzymalosc = 20;
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_forward(FM_PlayerPreThink, "rendering", 1);
RegisterHam(Ham_Spawn, "player", "grawitacja", 1);
RegisterHam(Ham_Spawn, "player", "model");
register_event("CurWeapon", "CurWeapon", "be", "1=1")
}
public cod_class_enabled(id)
{
entity_set_float(id, EV_FL_gravity, 500.0/800.0);
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
entity_set_float(id, EV_FL_gravity, 1.0);
ma_klase[id] = false;
}
public plugin_precache()
{
static szModel[ ] = "models/player/terror/terror.mdl";
precache_model( szModel );
}
public rendering(id)
{
if(!ma_klase[id])
return;
new button = get_user_button(id);
if( button & IN_DUCK && get_user_weapon(id) == CSW_KNIFE)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 20);
}
else
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
}
}
public grawitacja(id)
{
if(!ma_klase[id])
return;
if(get_user_weapon(id) == CSW_KNIFE)
{
entity_set_float(id, EV_FL_gravity, 500.0/800.0);
}
else
{
entity_set_float(id, EV_FL_gravity, 800.0);
}
}
public CurWeapon(id)
{
new weapon = read_data(2);
if(ma_klase[id])
{
if(weapon == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/cod/v_knife.mdl")
}
}
}
public model( id )
{
if( !is_user_alive( id ) || !ma_klase[ id ] )
return;
engfunc( EngFunc_SetClientKeyValue, id, engfunc( EngFunc_GetInfoKeyBuffer, id ), "model", "terror" );
}
Użytkownik Jadek edytował ten post 07.03.2013 22:49