L*Y*Y* 发表于 2008-11-25 14:55:11

请教个原码问题?

这是个丧尸传染版烟雾弹变照明弹插件原码,我想改成闪光弹变照明弹,怎么改呀?因为我有了烟雾弹变冰冻弹,所以不能没有照明弹,请教高手!!!
include <amxmodx>
#include <fakemeta>
#tryinclude <biohazard>
#if !defined _biohazard_included
      #assert Biohazard functions file required!
#endif
#define pev_flare pev_iuser4
#define flare_id 1337
#define is_ent_flare(%1) (pev(%1, pev_flare) == flare_id) ? 1 : 0
new const g_flare_model[] = "models/w_flare.mdl"
new cvar_smokeflare, cvar_smokeflare_dur
public plugin_init()
{
register_plugin("smoke flare", "0.1", "mini_midget/cheap_suit")
is_biomod_active() ? plugin_init2() : pause("ad")
}
public plugin_precache()
precache_model(g_flare_model)
public plugin_init2()
{
register_forward(FM_SetModel, "fwd_setmodel")
register_forward(FM_Think, "fwd_think")
cvar_smokeflare = register_cvar("bh_flare_enable",   "1")
cvar_smokeflare_dur = register_cvar("bh_flare_duration", "999.9")
}
public fwd_setmodel(ent, const model[])
{
if(!pev_valid(ent) || !equal(model, "smokegrenade.mdl"))
return FMRES_IGNORED

static classname; pev(ent, pev_classname, classname, 31)
if(equal(classname, "grenade") && get_pcvar_num(cvar_smokeflare))
{
engfunc(EngFunc_SetModel, ent, g_flare_model)
set_pev(ent, pev_effects, EF_BRIGHTLIGHT)
set_pev(ent, pev_flare,   flare_id)
set_pev(ent, pev_nextthink, get_gametime() + get_pcvar_float(cvar_smokeflare_dur))
fm_set_rendering(ent, kRenderFxGlowShell, 150, 150, 250, kRenderNormal, 16)

return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public fwd_think(ent) if(pev_valid(ent) && is_ent_flare(ent))
engfunc(EngFunc_RemoveEntity, ent)
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color; color = float(b), color = float(r), color = float(g)

set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode,render)
set_pev(entity, pev_renderamt,   float(amount))
return 1
}

Rulzy 发表于 2008-11-25 18:58:36

回复: 请教个原码问题?

把 smokegrenade.mdl 改成 flashbang.mdl试试。

L*Y*Y* 发表于 2008-11-26 08:21:12

回复: 请教个原码问题?

谢谢,我试验一下!!

L*Y*Y* 发表于 2008-11-26 10:39:45

回复: 请教个原码问题?

不错,谢谢斑竹!!!
页: [1]
查看完整版本: 请教个原码问题?