#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Crowbar"
#define VERSION "0.1"
#define AUTHOR "SAMURAI"
#define V_MODEL "models/v_crowbar.mdl"
#define W_MODEL "models/w_crowbar.mdl"
#define P_MODEL "models/p_crowbar.mdl"
#define KNIFE_W_MODEL "models/w_knife.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
// HL Event CurWeapon
register_event("CurWeapon", "Event_CurWeapon", "be","1=1");
// FM_SetModel Fakemeta forward
register_forward(FM_SetModel,"fw_setmodel"/*,1*/);
}
// Plugin Precache forward
public plugin_precache()
{
// precache the required models
engfunc(EngFunc_PrecacheModel,V_MODEL);
engfunc(EngFunc_PrecacheModel,P_MODEL);
engfunc(EngFunc_PrecacheModel,W_MODEL);
}
public Event_CurWeapon(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE;
new weaponID = read_data(2);
if(weaponID != CSW_KNIFE)
return PLUGIN_CONTINUE;
set_pev(id, pev_viewmodel2, V_MODEL);
set_pev(id, pev_weaponmodel2, P_MODEL);
return PLUGIN_CONTINUE;
}
public fw_setmodel(ent,const model[])
{
// check if isn't a valid model
if(!pev_valid(ent))
return FMRES_IGNORED;
// if isn't w_knife model
if(strcmp(KNIFE_W_MODEL,model) )
return FMRES_IGNORED;
// get ent classname
static classname[32]
pev(ent,pev_classname,classname,31);
if(!strcmp(classname, "weaponbox") || !strcmp(classname, "armoury_entity") || !strcmp(classname, "grenade"))
{
// set model
engfunc(EngFunc_SetModel, ent, W_MODEL);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
Czy jest możliwość przerobienia że łom będzie tylko dla CT a terroryści bd mieć normalnie nóż?


Dodatki SourceMod



Temat jest zamknięty









