AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Lamp (Flickering | Brightness) (https://forums.alliedmods.net/showthread.php?t=251897)

Xalus 11-21-2014 17:48

Lamp (Flickering | Brightness)
 
Hello, after struggling and searching for some time,
I'm gonna ask you guys.

I wanna make some of the lights flicker, when I want it to.
This is the code I've found atm, setting 'light-style' to 1,
doesnt give the effect I'm looking for, and it seems a bit buggy.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Nightcrawler Addon: Lamp"
#define VERSION "1.0"
#define AUTHOR "Xalus"

const m_iStyle 34
new const g_strLampname[] = "nc_lights"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
plugin_precache()
{
    
register_forward(FM_Spawn"Forward_Spawn");
}

public 
Forward_SpawniEnt )
{   
    if(!
pev_valid(iEnt))
        return
    
    static 
strClassname32 ];
    
    
pev(iEntpev_classnamestrClassnamecharsmax(strClassname));
    if(
strClassname[0] == 'l'
    
&& strClassname[4] == 't'
    
&& !strClassname[5])
    {
        
log_amx("Found class: %s"strClassname)
        
set_pev(iEntpev_targetnameg_strLampname)
    
        
log_amx("Found LAMP: %i (Style: %i) (Effect: %i), (Brightness: %i)"iEntget_pdata_int(iEntm_iStyle), pev(iEntpev_effects), pev(iEntpev_renderamt))
        
        
        
//set_pdata_int(iEnt, m_iStyle, 10)
        //set_pev(iEnt, pev_light_level, 180)
    
}
        
//g_iLamp
        
        //DispatchKeyValue( iEnt, "style", "1" );
        //set_pdata_int(iEnt, m_iStyle, 1)



.Dare Devil. 11-22-2014 01:01

Re: Lamp (Flickering | Brightness)
 
There was a string what holds data about lighting.
( a - dark, z- bright and something between is something between hehe )
Anyways, changing the light style to unused from engine and then editing that string thing you can make your own light fade/flickering what ever thingy.


All times are GMT -4. The time now is 17:38.

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