Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Tourney"
#define VERSION "1.0"
#define AUTHOR "emoD"
new team_name[2][32]
new Game_Status = 0
new Half = 0
new team_wins[2]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("em_start", "Game_Begin")
register_event("TeamScore", "team_score", "a")
register_event("HLTV", "new_round", "a", "1=0", "2=0")
}
public Game_Begin(id, level, cid)
{
Game_Status = 1
Half = 1
read_argv(1, team_name[0], 31)
read_argv(1, team_name[1], 32)
set_task(2.0, "Msg_TeamName")
set_task(4.0, "Msg_Live")
set_task(6.0, "Msg_Live1")
set_task(8.0, "restart_round", 0, "1", 1)
set_task(10.0, "restart_round", 0, "1", 1)
set_task(12.0, "restart_round", 0, "3", 1)
set_task(17.0, "Msg_Live2")
set_task(18.0, "Msg_Live3")
return PLUGIN_HANDLED
}
public restart_round(time[])
{
server_cmd("sv_restart %s", time)
}
public Msg_Live()
{
client_print(0, print_chat, "Console: All Players Ready Up, Game Starting!")
}
public Msg_Live1()
{
client_print(0, print_chat, "Console: Three Restarts Then Game Is Live!")
}
public Msg_Live2()
{
client_print(0, print_chat, "Console: Game Is ON!")
}
public Msg_Live3()
{
client_print(0, print_chat, "Console: Good Luck And Have Fun!")
}
public Msg_TeamName()
{
client_print(0, print_chat, "Console: %s VS %s", team_name[0], team_name[1])
}
public team_score()
{
new team[2]
read_data(1, team, 1)
if (team[0] == 'C')
team_wins[0] = read_data(2)
else if(team[0] == 'T')
team_wins[1] = read_data(2)
if( team_wins[0]+team_wins[1] == 15 && Half == 1)
{
Half = 2
client_print(0, print_chat, "Console: First Half Ended, Please Change")
client_print(0, print_chat, "Console: After 15 Seconds Second Half Begins")
set_task(2.0, "restart_round", 0, "15", 1)
set_task(20.0, "Msg_Live")
set_task(21.0, "Msg_Live1")
set_task(23.0, "restart_round", 0, "1", 1)
set_task(25.0, "restart_round", 0, "1", 1)
set_task(27.0, "restart_round", 0, "3", 1)
set_task(31.0, "Msg_Live2")
set_task(31.5, "Msg_Live3")
} else if(Half == 2) {
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}