Quote:
Originally Posted by naSTR
Can someone make it in zp4.3???
|
Learn its simple.
PHP Code:
#include <amxmodx>
#include <colorchat>
#define PLUGIN "[ZP] Automatic light change"
#define VERSION "1.0"
#define AUTHOR "lambda"
new counter
new const num_to_flag[4][] = { "d","c","b","a" }
new cvar_enabled
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
counter = -20 + random_num(0, 10)
cvar_enabled = register_cvar("zp_autolight_enable", "1")
}
public event_round_start()
{
counter++
if (get_pcvar_num(cvar_enabled))
{
if(counter < sizeof(num_to_flag) && counter >= 0 )
{
set_cvar_string("zp_lighting", num_to_flag[counter])
switch(counter)
{
case 0:
ColorChat(0, TEAM_COLOR, "^4[ZP]^1 It's starting to get dark...")
case 1:
ColorChat(0, TEAM_COLOR, "^4[ZP]^1 It's better to get inside...")
case 2:
ColorChat(0, TEAM_COLOR, "^4[ZP]^1 Beware of the dark...")
case 3:
ColorChat(0, TEAM_COLOR, "^4[ZP]^1 It's midnight.")
}
}
}
}
__________________