have any way to leave it like that?
and also add a cvar to set the brightness from the beginning of the map.
Example: amx_set_light c
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define VERSION "0.0.1"
#define PLUGIN "Change Light"
#define LIGHT_STYLE(%0,%1) engfunc(EngFunc_LightStyle, %0, %1)
new g_szCurrentLight[2]
public plugin_init() {
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
register_concmd("amx_set_light", "set_light", ADMIN_CFG, "<a-z>")
}
public plugin_precache() {
register_forward(FM_LightStyle, "LightStyle", 1)
}
public LightStyle(iStyle, szPattern[]) {
if( !iStyle )
{
g_szCurrentLight[0] = szPattern[0]
}
}
public set_light( id, lvl, cmd ) {
if( cmd_access(id, lvl, cmd, 1) )
{
if( read_argc() == 2 )
{
read_argv(1, g_szCurrentLight, charsmax(g_szCurrentLight))
LIGHT_STYLE(0, g_szCurrentLight)
}
else if( g_szCurrentLight[0] )
{
console_print(id, "Current Light is %d (%c)", g_szCurrentLight[0] - 'a', g_szCurrentLight[0])
}
else
{
console_print(id, "No light is actually set oO !!")
}
}
return PLUGIN_HANDLED
}