Install a plugin called amx_lights
https://forums.alliedmods.net/showthread.php?t=3395 , to use in conjunction with this
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define TASK_LIGHTS1 1000
#define TASK_LIGHTS2 1001
#define TASK_LIGHTS3 1002
new const g_szSndWolf1[] = "wolf/wolf1.mp3";
new const g_szSndWolf2[] = "wolf/wolf2.mp3";
public plugin_precache()
{
precache_sound( g_szSndWolf1 );
precache_sound( g_szSndWolf2 );
}
public plugin_init()
{
register_plugin("Night Wolf", "0.1", "AUTHOR")
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
}
public Event_HLTV_New_Round()
{
server_cmd("amx_lights m")
remove_task(TASK_LIGHTS1)
remove_task(TASK_LIGHTS2)
remove_task(TASK_LIGHTS3)
set_task(60.0, "light_phase_one", TASK_LIGHTS1)
set_task(240.0, "light_phase_msg", TASK_LIGHTS2)
set_task(300.0, "light_phase_two", TASK_LIGHTS2)
}
public light_phase_one()
{
server_cmd("amx_lights g")
set_hudmessage(0, 255, 0, -1.0, 0.0, 0, 12.0, 10.0)
show_hudmessage(0, "It's Day Time !!")
return PLUGIN_CONTINUE
}
public light_phase_msg()
{
set_hudmessage(0, 255, 0, -1.0, 0.0, 0, 12.0, 10.0)
show_hudmessage(0, "It's time to prepare your nightvision and flashlight !!")
client_cmd( 0, "mp3 play sound/%s", g_szSndWolf1 );
return PLUGIN_CONTINUE
}
public light_phase_two()
{
server_cmd("amx_lights a")
set_hudmessage(0, 255, 0, -1.0, 0.0, 0, 12.0, 10.0)
show_hudmessage(0, "It's dark now !!")
client_cmd( 0, "mp3 play sound/%s", g_szSndWolf2 );
return PLUGIN_CONTINUE
}
__________________