Thank you so much! The reason I wanted to keep them was to set flickering lights to normal. The map that I'm testing has lights set their appearance to "Flicker B", which corresponds to value 6 for m_iStyle
http://wiki.amxmodx.org/CLight_%28CS%29
From that link I actually verified that I can read that style using get_pdata_int(iEnt, 33) and I do read 6 for the ones that flicker. In your spawn hook function I added a set_pdata_int line and when I do that I do read 0 for the m_iStyle value; however the lights still flicker.
PHP Code:
public Forward_Spawn( iEnt )
{
static szName[ 32 ];
pev( iEnt, pev_targetname, szName, charsmax( szName ) );
if( !strlen( szName ) )
{
set_pdata_int(iEnt, 33, 0)
DispatchKeyValue( iEnt, "targetname", "some_targetname" );
}
}
Is DispatchKeyValue the only way to modify an entity before spawn? As far as I researched, the DispatchKeyValue function only accepts strings for key-value pairs. And unfortunately I couldn't find a pev_* variable for m_iStyle. Any ideas?
Thanks a lot again!