#include <amxmodx>
#include <fakemeta>
new const FLARE_MODEL[] = "models/w_flare.mdl";
new pcvar_flare_duration;
public plugin_init()
{
register_plugin("Smoke Flares", "0.1", "Mini_Midget")
pcvar_flare_duration = register_cvar("flare_duration", "20.0")
register_forward(FM_SetModel, "fw_setmodel")
register_forward(FM_Think, "fw_think");
}
public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, FLARE_MODEL);
//for (new i = 0 ; i < sizeof FLARE_SOUNDS ; i++)
// engfunc(EngFunc_PrecacheSound, FLARE_SOUNDS[i]);
}
public fw_setmodel(ent, model[])
{
//Not a valid ent or Thrower not alive
if (!pev_valid(ent) || !is_user_alive(pev(ent, pev_owner))) // not a valid ent
return FMRES_IGNORED;
new Float: duration = get_pcvar_float(pcvar_flare_duration)
if (equali(model,"models/w_smokegrenade.mdl"))
{
new className[33]
pev(ent, pev_classname, className, 32)
// Stop smoke grenade from exploding
set_pev(ent, pev_nextthink, get_gametime() + duration);
//Effects
set_pev(ent,pev_effects,EF_BRIGHTLIGHT);
fm_set_rendering(ent, kRenderFxGlowShell, 150, 150, 250, kRenderNormal, 16)
//Sound
//engfunc(EngFunc_EmitSound, ent, CHAN_AUTO, FLARE_SOUNDS[random(sizeof FLARE_SOUNDS)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
engfunc(EngFunc_SetModel, ent, FLARE_MODEL);
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED;
}
public fw_think(ent)
{
//Not a valid ent or Thrower not alive
if (!pev_valid(ent) || !is_user_alive(pev(ent, pev_owner))) // not a valid ent
return FMRES_IGNORED;
static classname[33]
pev(ent, pev_classname, classname, sizeof classname - 1);
static model[33]
pev(ent, pev_model, model, sizeof model - 1);
if( equal(model, FLARE_MODEL) && equal(classname, "grenade"))
engfunc(EngFunc_RemoveEntity, ent);
return FMRES_IGNORED;
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) {
new Float:RenderColor[3];
RenderColor[2] = float(b);
RenderColor[0] = float(r);
RenderColor[1] = float(g);
set_pev(entity, pev_renderfx, fx);
set_pev(entity, pev_rendercolor, RenderColor);
set_pev(entity, pev_rendermode, render);
set_pev(entity, pev_renderamt, float(amount));
return 1;
}
Sprawdzalem juz na wszystkie sposoby i nie moge tego zmienic i nie wiem czy wogóle sie da ale wole sie upewnic.
Linia 43 odpowiada za render granatu czyli te "otoczke" wokol a gdy zmieniam 74 nic sie nie dzieje.
proszę o wyrozumialosc, normalnie nie latam sie pytac o wszystko ale to mnie juz wkur*ilo...
Użytkownik ReZ'et edytował ten post 30.01.2011 23:33