AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   |SOLVED| Biohazard Smoke Flare problem (https://forums.alliedmods.net/showthread.php?t=252324)

Krtola 11-30-2014 11:51

|SOLVED| Biohazard Smoke Flare problem
 
The circuit of light is too large, and causes excessive lag.
I do not know how to reduce the size of the circle.
Is that even possible,please help?

PHP Code:

#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_smokeflarecvar_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[9], "smokegrenade.mdl"))
        return 
FMRES_IGNORED
    
    
static classname[32]; pev(entpev_classnameclassname31)
    if(
equal(classname"grenade") && get_pcvar_num(cvar_smokeflare))
    {
        
engfunc(EngFunc_SetModelentg_flare_model)
        
set_pev(entpev_effectsEF_BRIGHTLIGHT)
        
set_pev(entpev_flare,   flare_id)
        
set_pev(entpev_nextthinkget_gametime() + get_pcvar_float(cvar_smokeflare_dur))
        
fm_set_rendering(entkRenderFxGlowShell150150250kRenderNormal16)
        
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}

public 
fwd_think(ent) if(pev_valid(ent) && is_ent_flare(ent))
    
engfunc(EngFunc_RemoveEntityent)

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16
{
    static 
Float:color[3]; color[2] = float(b), color[0] = float(r), color[1] = float(g)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermode,  render)
    
set_pev(entitypev_renderamt,   float(amount))

    return 
1


problem solved,I found the solution here
https://forums.alliedmods.net/showth...ght=smokeflare


All times are GMT -4. The time now is 15:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.