This brings me new hopes:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
public plugin_precache()
{
register_forward( FM_Spawn, "Forward_Spawn" );
}
public Forward_Spawn( iEnt )
{
static szName[ 32 ];
pev( iEnt, pev_classname, szName, charsmax( szName ) );
if( equali(szName, "light"))
{
set_pev( iEnt, pev_spawnflags, 1)
DispatchKeyValue( iEnt, "targetname", "shack" );
DispatchKeyValue( iEnt, "pattern", "amamamamamamamamamamam" )
}
}
cs_militia has many lights connected to switches. One of the switch's target is "shack". When I test this plugin on cs_militia, all the lights start turned off because of the spawnflags being 1. And when I press E on the switch, all the lights turn on and flicker with the pattern amamam... Without this plugin they all start on and their style is normal. But when I test this on bkz_ancient, the lights act like the same before(Flicker B). So obviously these lights with switches have some data written to them when the maps get loaded and we're missing some piece(s). I'm going to try to output every single data these lights have and see what the differences are with lights which are not designed to have a targetname in the first place.
I tried these additions to Forward_Spawn:
PHP Code:
DispatchKeyValue( iEnt, "style", "0")
DispatchKeyValue( iEnt, "style", "32")
DispatchKeyValue( iEnt, "style", "63")
Any of these additions caused the light to be always on with constant illumination and the switch stopped working. Then I looked at cs_militia with hammer and saw that style was set to 33. When I tried this addition:
PHP Code:
DispatchKeyValue( iEnt, "style", "33")
The light started off and blinked amamam... when turned on. From lights.cpp I can't see any difference between 32 and 33. This is weird...