I don't really understand what you are trying to do but, just to offer more options:
You can use looped sequenced lights:
Code:
set_lights("aaaaaaaaaaabcdeeeeeefg")
It holds on light A for some time then goes to B,C and D then holds some time on E and then goes to F an G and then again from A... I don't really know how to end the loop but you can just set a task and set the lights to a fixed value.
Or if you just want to increase or decrease lightning:
Code:
#include <amxmodx>
#include <engine>
new const g_szLights[][] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }
new g_iLight
public plugin_init()
{
//g_iLight = 12 // I don't remember how to get the light level
}
stock adjustLights(iVal)
{
if(iVal == 0)
{
set_lights("#OFF")
//g_iLight = -1 // I don't remember how to get the light level
return
}
g_iLight = clamp(g_iLight + iVal, 0, sizeof g_szLights)
set_lights(g_szLights[g_iLight])
client_print(0, print_chat, "[debug] %s%d lights - light is now %s ", (iVal > 0 ? "+" : ""), iSet, g_szLights[g_iLight])
}
Use adjustLights(value) to adjust the lights, give it positive or negative values, 0 resets light level.
Ex:
adjustLights(1) increases the light level by 1
adjustLights(-5) decreases the light level by 5
adjustLights(0) resets light level to map default.
__________________