> I need to set up some code to toggle a light entity on and off i would think > this would be done by calling CLight :: Use but i cant figure out how to use > this function i was wondering if someone could tell me if this is what i > need to use and how to call it propperly
Looking in lights.cpp at the CLight::Use() function, the SF_LIGHT_START_OFF bit in the pev->spawnflags is toggled on or off when lights are turned on and off. Just call the Use() function with a bogus pActivator and pCaller field (since these aren't used in that function). The useType would probably be USE_TOGGLE. The value argument also isn't used (so it can be anything you want). If you've already got the pLight pointer to the CLight entity, just use something like this... pLight->Use(NULL, NULL, USE_TOGGLE, 0); // toggle on or off If you don't have the pLight pointer to an entity, you'll have to loop through the light entities (UTIL_FindEntityByClassname?) and access the CLight class using GetClassPtr(). There's examples of doing this in the SDK (just search for GetClassPtr). Jeffrey "botman" Broome _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

